query_name
stringlengths
13
55
code_file_path
stringlengths
14
194
context_blocks
list
answer_spans
list
supporting_fact_spans
list
example_type
int8
0
1
single_hop
bool
2 classes
subtokenized_input_sequence
sequence
label_sequence
sequence
Unused import
openworm/PyOpenWorm/tests/MuscleTest.py
[ { "content": "from __future__ import print_function\nimport sys\nsys.path.insert(0,\".\")\nimport unittest\nimport neuroml\nimport neuroml.writers as writers\nimport PyOpenWorm\nfrom PyOpenWorm import *\nimport networkx\nimport rdflib\nimport rdflib as R\nimport pint as Q\nimport os\nimport subprocess as SP\nimport subprocess\nimport tempfile\nimport doctest\n\nfrom glob import glob\n\nfrom GraphDBInit import *\n\nfrom DataTestTemplate import _DataTest\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class MuscleTest(_DataTest):\n\n\n", "metadata": "root.MuscleTest", "header": "['module', '___EOS___']", "index": 24 }, { "content": " def test_muscle(self):\n self.assertTrue(isinstance(Muscle(name='MDL08'), Muscle))", "metadata": "root.MuscleTest.test_muscle", "header": "['class', 'MuscleTest', '(', '_DataTest', ')', ':', '___EOS___']", "index": 26 }, { "content": " def test_innervatedBy(self):\n m = Muscle('MDL08')\n n = Neuron('some neuron')\n m.innervatedBy(n)\n m.save()\n v = Muscle(name='MDL08')\n self.assertIn(n, list(v.innervatedBy()))", "metadata": "root.MuscleTest.test_innervatedBy", "header": "['class', 'MuscleTest', '(', '_DataTest', ')', ':', '___EOS___']", "index": 29 }, { "content": " def test_muscle_neurons(self):\n \"\"\" Should be the same as innervatedBy \"\"\"\n m = Muscle(name='MDL08')\n neu = Neuron(name=\"tnnetenba\")\n m.neurons(neu)\n m.save()\n\n m = Muscle(name='MDL08')\n self.assertIn(Neuron('tnnetenba'), list(m.neurons()))", "metadata": "root.MuscleTest.test_muscle_neurons", "header": "['class', 'MuscleTest', '(', '_DataTest', ')', ':', '___EOS___']", "index": 37 } ]
[ { "span": "import unittest", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 15 }, { "span": "import neuroml", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 14 }, { "span": "import neuroml.writers as writers", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 33 }, { "span": "import PyOpenWorm", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 17 }, { "span": "import networkx", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 15 }, { "span": "import rdflib", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 13 }, { "span": "import rdflib as R", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 18 }, { "span": "import pint as Q", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 16 }, { "span": "import os", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 9 }, { "span": "import subprocess as SP", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 23 }, { "span": "import subprocess", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 17 }, { "span": "import tempfile", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 15 }, { "span": "import doctest", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 14 }, { "span": "from glob import glob", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 21 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[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_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "\".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "neuro", "ml_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "neuro", "ml_", "._", "writers_", "as_", "writers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Py", "Open", "Wor", "m_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Py", "Open", "Wor", "m_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "networkx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "rdflib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "rdflib_", "as_", "R_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pint", "_", "as_", "Q_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "as_", "SP_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "tempfile_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "doctest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "glob_", "import_", "glob_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Graph", "DB", "Init_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "Data", "Test", "Template_", "import_", "\\u", "Data", "Test_", "\\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_", "Mus", "cle", "Test_", "(_", "\\u", "Data", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Mus", "cle", "Test_", "(_", "\\u", "Data", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "musc", "le_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "isinstance_", "(_", "Mus", "cle_", "(_", "name_", "=_", "'", "MD", "L0", "8", "'_", ")_", ",_", "Mus", "cle_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mus", "cle", "Test_", "(_", "\\u", "Data", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "inner", "vat", "ed", "By_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "Mus", "cle_", "(_", "'", "MD", "L0", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "Neuron_", "(_", "'", "some", " ", "neuro", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "inner", "vat", "ed", "By_", "(_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "Mus", "cle_", "(_", "name_", "=_", "'", "MD", "L0", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "n_", ",_", "list_", "(_", "v_", "._", "inner", "vat", "ed", "By_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Mus", "cle", "Test_", "(_", "\\u", "Data", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "musc", "le", "\\u", "neurons_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Sho", "ul", "d", " ", "be", " ", "the", " ", "same", " ", "as", " ", "inner", "vat", "ed", "By", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "Mus", "cle_", "(_", "name_", "=_", "'", "MD", "L0", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "neu", "_", "=_", "Neuron_", "(_", "name_", "=_", "\"", "tn", "net", "enb", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "neurons_", "(_", "neu", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "save_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "=_", "Mus", "cle_", "(_", "name_", "=_", "'", "MD", "L0", "8", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "Neuron_", "(_", "'", "tn", "net", "enb", "a", "'_", ")_", ",_", "list_", "(_", "m_", "._", "neurons_", "(_", ")_", ")_", ")_" ]
[ 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, 0, 1, 2, 0, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 2, 0, 1, 1, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 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, 4, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
ericholscher/django-test-utils/test_utils/test_runners/keep_database.py
[ { "content": "def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]):\n \"\"\"\n worsk exactly as per normal test\n but only creates the test_db if it doesn't yet exist\n and does not destroy it when done\n tables are flushed and fixtures loaded between tests as per usual\n but if your schema has not changed then this saves significant amounts of time\n and speeds up the test cycle\n\n Run the unit tests for all the test labels in the provided list.\n Labels must be of the form:\n - app.TestClass.test_method\n Run a single specific test method\n - app.TestClass\n Run all the test methods in a given class\n - app\n Search for doctests and unittests in the named application.\n\n When looking for tests, the test runner will look in the models and\n tests modules for the application.\n\n A list of 'extra' tests may also be provided; these tests\n will be added to the test suite.\n\n Returns the number of tests that failed.\n \"\"\"\n setup_test_environment()\n\n settings.DEBUG = False\n suite = unittest.TestSuite()\n\n if test_labels:\n for label in test_labels:\n if '.' in label:\n suite.addTest(build_test(label))\n else:\n app = get_app(label)\n suite.addTest(build_suite(app))\n else:\n for app in get_apps():\n suite.addTest(build_suite(app))\n\n for test in extra_tests:\n suite.addTest(test)\n\n suite = reorder_suite(suite, (TestCase,))\n\n old_name = settings.DATABASES['default']['NAME']\n\n ###Everything up to here is from django.test.simple\n\n from django.db.backends import creation\n from django.db import connection, DatabaseError\n\n if settings.DATABASES['default']['TEST_NAME']:\n settings.DATABASES['default']['NAME'] = settings.DATABASES['default']['TEST_NAME']\n else:\n settings.DATABASES['default']['NAME'] = creation.TEST_DATABASE_PREFIX + settings.DATABASES['default']['NAME']\n connection.settings_dict[\"DATABASE_NAME\"] = settings.DATABASES['default']['NAME']\n\n # does test db exist already ?\n try:\n if settings.DATABASES['default']['ENGINE'] == 'sqlite3':\n if not os.path.exists(settings.DATABASES['default']['NAME']):\n raise DatabaseError\n cursor = connection.cursor()\n except Exception:\n # db does not exist\n # juggling ! create_test_db switches the DATABASE_NAME to the TEST_DATABASE_NAME\n settings.DATABASES['default']['NAME'] = old_name\n connection.settings_dict[\"DATABASE_NAME\"] = old_name\n connection.creation.create_test_db(verbosity, autoclobber=True)\n else:\n connection.close()\n\n settings.DATABASES['default']['SUPPORTS_TRANSACTIONS'] = connections_support_transactions()\n\n result = unittest.TextTestRunner(verbosity=verbosity).run(suite)\n\n #Since we don't call destory_test_db, we need to set the db name back.\n settings.DATABASES['default']['NAME'] = old_name\n connection.settings_dict[\"DATABASE_NAME\"] = old_name\n teardown_test_environment()\n\n return len(result.failures) + len(result.errors)", "metadata": "root.run_tests", "header": "['module', '___EOS___']", "index": 12 } ]
[ { "span": "cursor ", "start_line": 77, "start_column": 8, "end_line": 77, "end_column": 14 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "run", "\\u", "tests_", "(_", "test\\u", "labels_", ",_", "verbosity_", "=_", "1_", ",_", "interactive_", "=_", "True_", ",_", "extra", "\\u", "tests_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "wor", "sk", " ", "exact", "ly", " ", "as", " ", "per", " ", "normal", " ", "test", "\\", "10", ";", " ", " ", " ", " ", "but", " ", "only", " ", "create", "s", " ", "the", " ", "test\\u", "db", " ", "if", " ", "it", " ", "doe", "sn", "'", "t", " ", "ye", "t", " ", "exist", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "doe", "s", " ", "not", " ", "destroy", " ", "it", " ", "whe", "n", " ", "don", "e", "\\", "10", ";", " ", " ", " ", " ", "tables", " ", "are", " ", "flush", "ed", " ", "and", " ", "fixture", "s", " ", "load", "ed", " ", "bet", "ween", " ", "tests", " ", "as", " ", "per", " ", "usual", "\\", "10", ";", " ", " ", " ", " ", "but", " ", "if", " ", "your", " ", "schema", " ", "has", " ", "not", " ", "change", "d", " ", "then", " ", "this", " ", "save", "s", " ", "significant", " ", "amounts", " ", "of", " ", "time", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "speeds", " ", "up", " ", "the", " ", "test", " ", "cycle", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Run", " ", "the", " ", "unit", " ", "tests", " ", "for", " ", "all", " ", "the", " ", "test", " ", "labels", " ", "in", " ", "the", " ", "provided", " ", "list", ".", "\\", "10", ";", " ", " ", " ", " ", "Label", "s", " ", "must", " ", "be", " ", "of", " ", "the", " ", "form", ":", "\\", "10", ";", " ", "-", " ", "app", ".", "Test", "Class", ".", "test\\u", "method", "\\", "10", ";", " ", " ", " ", " ", "Run", " ", "a", " ", "single", " ", "specific", " ", "test", " ", "method", "\\", "10", ";", " ", "-", " ", "app", ".", "Test", "Class", "\\", "10", ";", " ", " ", " ", " ", "Run", " ", "all", " ", "the", " ", "test", " ", "method", "s", " ", "in", " ", "a", " ", "give", "n", " ", "class", "\\", "10", ";", " ", "-", " ", "app", "\\", "10", ";", " ", " ", " ", " ", "Sear", "ch", " ", "for", " ", "docte", "sts", " ", "and", " ", "unittest", "s", " ", "in", " ", "the", " ", "named", " ", "applica", "tion", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Whe", "n", " ", "look", "ing", " ", "for", " ", "tests", ",", " ", "the", " ", "test", " ", "runn", "er", " ", "will", " ", "look", " ", "in", " ", "the", " ", "model", "s", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "tests", " ", "module", "s", " ", "for", " ", "the", " ", "applica", "tion", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "list", " ", "of", " ", "'", "extra", "'", " ", "tests", " ", "may", " ", "als", "o", " ", "be", " ", "provided", ";", " ", "these", " ", "tests", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "be", " ", "adde", "d", " ", "to", " ", "the", " ", "test", " ", "suit", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "number", " ", "of", " ", "tests", " ", "tha", "t", " ", "fail", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "setup", "\\u", "test\\u", "environment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "settings_", "._", "DEBUG_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "=_", "unittest_", "._", "Test", "Suite_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "test\\u", "labels_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "label_", "in_", "test\\u", "labels_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'.'_", "in_", "label_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "._", "add", "Test_", "(_", "build", "\\u", "test_", "(_", "label_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app_", "=_", "get", "\\u", "app_", "(_", "label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suite_", "._", "add", "Test_", "(_", "build", "\\u", "suite_", "(_", "app_", ")_", ")_", "\\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 ", " _", "for_", "app_", "in_", "get", "\\u", "apps_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "._", "add", "Test_", "(_", "build", "\\u", "suite_", "(_", "app_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "test_", "in_", "extra", "\\u", "tests_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "._", "add", "Test_", "(_", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "suite_", "=_", "reorder", "\\u", "suite_", "(_", "suite_", ",_", "(_", "Test", "Case_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "old", "\\u", "name_", "=_", "settings_", "._", "DATABASES_", "[_", "'", "default", "'_", "]_", "[_", "'", "NAME", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", "Every", "thing", " ", "up", " ", "to", " ", "here", " ", "is", " ", "from", " ", "django", ".", "test", ".", "simple_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "backends_", "import_", "creation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "connection_", ",_", "Databa", "se", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "settings_", "._", "DATABASES_", "[_", "'", "default", "'_", "]_", "[_", "'", "TEST", "\\u", "NAME", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "settings_", "._", "DATABASES_", "[_", "'", "default", "'_", "]_", "[_", "'", "NAME", "'_", "]_", "=_", "settings_", "._", "DATABASES_", "[_", "'", "default", "'_", "]_", "[_", "'", "TEST", "\\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 ", " _", "settings_", "._", "DATABASES_", "[_", "'", "default", "'_", "]_", "[_", "'", "NAME", "'_", "]_", "=_", "creation_", "._", "TEST", "\\u", "DATA", "BASE", "\\u", "PREFIX_", "+_", "settings_", "._", "DATABASES_", "[_", "'", "default", "'_", "]_", "[_", "'", "NAME", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "connection_", "._", "settings", "\\u", "dict_", "[_", "\"", "DATA", "BASE", "\\u", "NAME", "\"_", "]_", "=_", "settings_", "._", "DATABASES_", "[_", "'", "default", "'_", "]_", "[_", "'", "NAME", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "doe", "s", " ", "test", " ", "db", " ", "exist", " ", "alr", "ead", "y", " ", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "settings_", "._", "DATABASES_", "[_", "'", "default", "'_", "]_", "[_", "'", "ENGINE", "'_", "]_", "==_", "'", "sql", "ite", "3", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "settings_", "._", "DATABASES_", "[_", "'", "default", "'_", "]_", "[_", "'", "NAME", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Databa", "se", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cursor_", "=_", "connection_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "db", " ", "doe", "s", " ", "not", " ", "exist_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "jug", "glin", "g", " ", "!", " ", " ", "create", "\\u", "test\\u", "db", " ", "switche", "s", " ", "the", " ", "DATA", "BASE", "\\u", "NAME", " ", "to", " ", "the", " ", "TEST", "\\u", "DATA", "BASE", "\\u", "NAME_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "settings_", "._", "DATABASES_", "[_", "'", "default", "'_", "]_", "[_", "'", "NAME", "'_", "]_", "=_", "old", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connection_", "._", "settings", "\\u", "dict_", "[_", "\"", "DATA", "BASE", "\\u", "NAME", "\"_", "]_", "=_", "old", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connection_", "._", "creation_", "._", "create", "\\u", "test\\u", "db_", "(_", "verbosity_", ",_", "autocl", "ob", "ber_", "=_", "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 ", " _", "connection_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "settings_", "._", "DATABASES_", "[_", "'", "default", "'_", "]_", "[_", "'", "SUPPORT", "S", "\\u", "TRANSACTION", "S", "'_", "]_", "=_", "connections", "\\u", "support", "\\u", "transactions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "unittest_", "._", "Text", "Test", "Runner_", "(_", "verbosity_", "=_", "verbosity_", ")_", "._", "run_", "(_", "suite_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Sin", "ce", " ", "we", " ", "don", "'", "t", " ", "call", " ", "dest", "ory", "\\u", "test\\u", "db", ",", " ", "we", " ", "need", " ", "to", " ", "set", " ", "the", " ", "db", " ", "name", " ", "back", "._", "\\u\\u\\uNL\\u\\u\\u_", "settings_", "._", "DATABASES_", "[_", "'", "default", "'_", "]_", "[_", "'", "NAME", "'_", "]_", "=_", "old", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connection_", "._", "settings", "\\u", "dict_", "[_", "\"", "DATA", "BASE", "\\u", "NAME", "\"_", "]_", "=_", "old", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tear", "down", "\\u", "test\\u", "environment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "len_", "(_", "result_", "._", "failures_", ")_", "+_", "len_", "(_", "result_", "._", "errors_", ")_" ]
[ 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, 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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 ]
Unused import
dieseldev/diesel/examples/test_dnosetest.py
[ { "content": "\"\"\"Here is an example test module that can be run with `dnosetests`.\n\nIt is written like a standard nose test module but the test functions are\nexecuted within the diesel event loop. That means they can fork other\ngreen threads, do network I/O and other diesel-ish things. Very handy for\nwriting integration tests against diesel services.\n\n\"\"\"\nimport time\n\nimport diesel\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def test_sleeps_then_passes():\n diesel.sleep(1)\n assert True", "metadata": "root.test_sleeps_then_passes", "header": "['module', '___EOS___']", "index": 13 }, { "content": "def test_sleeps_then_fails():\n diesel.sleep(1)\n assert False, \"OH NOES!\"", "metadata": "root.test_sleeps_then_fails", "header": "['module', '___EOS___']", "index": 17 } ]
[ { "span": "import time", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "Her", "e", " ", "is", " ", "an", " ", "example", " ", "test", " ", "module", " ", "tha", "t", " ", "can", " ", "be", " ", "run", " ", "with", " ", "`", "dno", "sete", "sts", "`.", "\\", "10", ";", "\\", "10", ";", "It", " ", "is", " ", "writt", "en", " ", "like", " ", "a", " ", "standard", " ", "nose", " ", "test", " ", "module", " ", "but", " ", "the", " ", "test", " ", "function", "s", " ", "are", "\\", "10", ";", "executed", " ", "within", " ", "the", " ", "diese", "l", " ", "event", " ", "loop", ".", " ", "Tha", "t", " ", "means", " ", "the", "y", " ", "can", " ", "fork", " ", "other", "\\", "10", ";", "green", " ", "thread", "s", ",", " ", "do", " ", "network", " ", "I", "/", "O", " ", "and", " ", "other", " ", "diese", "l", "-", "ish", " ", "thing", "s", ".", " ", "Ver", "y", " ", "hand", "y", " ", "for", "\\", "10", ";", "writ", "ing", " ", "integrati", "on", " ", "tests", " ", "against", " ", "diese", "l", " ", "service", "s", ".", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "diese", "l_", "\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "sleep", "s", "\\u", "then", "\\u", "passes_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diese", "l_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "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_", "test\\u", "sleep", "s", "\\u", "then", "\\u", "fails_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diese", "l_", "._", "sleep_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "False_", ",_", "\"", "OH", " ", "NO", "ES", "!\"_" ]
[ 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, 0, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
Bouke/django-user-sessions/user_sessions/management/commands/clearsessions.py
[ { "content": "try:\n from django.contrib.sessions.management.commands.clearsessions import Command # flake8: noqa\nexcept ImportError:\n pass # not supported on Django 1.4\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from django.contrib.sessions.management.commands.clearsessions import Command ", "start_line": 1, "start_column": 4, "end_line": 1, "end_column": 81 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "contrib_", "._", "sessions_", "._", "management_", "._", "commands_", "._", "clear", "sessions_", "import_", "Command_", "#", " ", "flake", "8", ":", " ", "no", "qa_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "#", " ", "not", " ", "support", "ed", " ", "on", " ", "Dj", "ang", "o", " ", "1.4_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 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 ]
Variable defined multiple times
Debian/debile/debile/slave/runners/adequate.py
[ { "content": "def adequate(chroot_name, target, package_name, analysis):\n with schroot(chroot_name) as chroot:\n chroot.copy(target, \"/tmp\")\n\n out, err, ret = chroot.run([\n 'apt-get', 'install', '-y', 'adequate'\n ], user='root')\n\n os.environ['DEBIAN_FRONTEND'] = 'noninteractive'\n out, err, ret = chroot.run([\n 'dpkg', '-i',\n \"/tmp/%s\" % target\n ], user='root', return_codes=(0, 1), preserve_environment=True)\n\n out, err, ret = chroot.run([\n 'apt-get', 'install', '-y', '-f'\n ], user='root', preserve_environment=True)\n\n out, err, ret = chroot.run(['adequate', package_name])\n\n failed = False\n for issue in parse_adequate(out.splitlines()):\n failed = True\n analysis.results.append(issue)\n\n return (analysis, out, failed, None, None)", "metadata": "root.adequate", "header": "['module', '___EOS___']", "index": 27 } ]
[ { "span": "out,", "start_line": 31, "start_column": 8, "end_line": 31, "end_column": 11 }, { "span": "err,", "start_line": 31, "start_column": 13, "end_line": 31, "end_column": 16 }, { "span": "ret ", "start_line": 31, "start_column": 18, "end_line": 31, "end_column": 21 }, { "span": "out,", "start_line": 36, "start_column": 8, "end_line": 36, "end_column": 11 }, { "span": "err,", "start_line": 36, "start_column": 13, "end_line": 36, "end_column": 16 }, { "span": "ret ", "start_line": 36, "start_column": 18, "end_line": 36, "end_column": 21 }, { "span": "out,", "start_line": 41, "start_column": 8, "end_line": 41, "end_column": 11 }, { "span": "err,", "start_line": 41, "start_column": 13, "end_line": 41, "end_column": 16 }, { "span": "ret ", "start_line": 41, "start_column": 18, "end_line": 41, "end_column": 21 } ]
[ { "span": "out,", "start_line": 45, "start_column": 8, "end_line": 45, "end_column": 11 }, { "span": "err,", "start_line": 45, "start_column": 13, "end_line": 45, "end_column": 16 }, { "span": "ret ", "start_line": 45, "start_column": 18, "end_line": 45, "end_column": 21 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "ade", "quat", "e_", "(_", "chroot", "\\u", "name_", ",_", "target_", ",_", "package", "\\u", "name_", ",_", "analysis_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "sch", "root_", "(_", "chroot", "\\u", "name_", ")_", "as_", "chroot", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chroot", "_", "._", "copy_", "(_", "target_", ",_", "\"/", "tmp", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "out_", ",_", "err_", ",_", "ret_", "=_", "chroot", "_", "._", "run_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "apt", "-", "get", "'_", ",_", "'", "install", "'_", ",_", "'-", "y", "'_", ",_", "'", "ade", "quat", "e", "'_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "user_", "=_", "'", "root", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "environ_", "[_", "'", "DEB", "IAN", "\\u", "FRONT", "END", "'_", "]_", "=_", "'", "non", "interactive", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", ",_", "err_", ",_", "ret_", "=_", "chroot", "_", "._", "run_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dpkg", "'_", ",_", "'-", "i", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"/", "tmp", "/", "%", "s", "\"_", "%_", "target_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "user_", "=_", "'", "root", "'_", ",_", "return", "\\u", "codes_", "=_", "(_", "0_", ",_", "1_", ")_", ",_", "preserve", "\\u", "environment_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "out_", ",_", "err_", ",_", "ret_", "=_", "chroot", "_", "._", "run_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "apt", "-", "get", "'_", ",_", "'", "install", "'_", ",_", "'-", "y", "'_", ",_", "'-", "f", "'_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "user_", "=_", "'", "root", "'_", ",_", "preserve", "\\u", "environment_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "out_", ",_", "err_", ",_", "ret_", "=_", "chroot", "_", "._", "run_", "(_", "[_", "'", "ade", "quat", "e", "'_", ",_", "package", "\\u", "name_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "failed_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "issue_", "in_", "parse", "\\u", "ade", "quat", "e_", "(_", "out_", "._", "splitlines_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "failed_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "analysis_", "._", "results_", "._", "append_", "(_", "issue_", ")_", "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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
yajiemiao/pdnn/models/sda.py
[ { "content": "# Copyright 2013 Yajie Miao Carnegie Mellon University\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# THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\n# WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\n# MERCHANTABLITY OR NON-INFRINGEMENT.\n# See the Apache 2 License for the specific language governing permissions and\n# limitations under the License.\n\nimport cPickle\nimport gzip\nimport os\nimport sys\nimport time\n\nimport numpy\n\nimport theano\nimport theano.tensor as T\nfrom theano.tensor.shared_randomstreams import RandomStreams\n\nfrom layers.logistic_sgd import LogisticRegression\nfrom layers.mlp import HiddenLayer\nfrom layers.da import dA, dA_maxout\n\n\n\n# an outdated class for SdA with maxout hidden activation. pre-training has been expirically found to be\n# NOT helpful for maxout networks, so we don't update this class\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class SdA(object):\n\n", "metadata": "root.SdA", "header": "['module', '___EOS___']", "index": 31 }, { "content": " def __init__(self, numpy_rng, theano_rng=None, cfg = None, dnn = None):\n \"\"\" Stacked Denoising Autoencoders for DNN Pre-training \"\"\"\n\n self.cfg = cfg\n self.hidden_layers_sizes = cfg.hidden_layers_sizes\n self.n_ins = cfg.n_ins\n self.hidden_layers_number = len(self.hidden_layers_sizes)\n\n self.dA_layers = []\n\n if not theano_rng:\n theano_rng = RandomStreams(numpy_rng.randint(2 ** 30))\n # allocate symbolic variables for the data\n self.x = dnn.x\n\n for i in xrange(self.hidden_layers_number):\n # the size of the input is either the number of hidden units of\n # the layer below, or the input size if we are on the first layer\n if i == 0:\n input_size = self.n_ins\n layer_input = self.x\n else:\n input_size = self.hidden_layers_sizes[i - 1]\n layer_input = dnn.layers[i-1].output\n\n # Construct a denoising autoencoder that shared weights with this layer\n if i == 0:\n reconstruct_activation = cfg.firstlayer_reconstruct_activation\n else:\n reconstruct_activation = cfg.hidden_activation\n dA_layer = dA(numpy_rng=numpy_rng,\n theano_rng=theano_rng,\n input=layer_input,\n n_visible=input_size,\n n_hidden=self.hidden_layers_sizes[i],\n W=dnn.layers[i].W,\n bhid=dnn.layers[i].b,\n sparsity = cfg.sparsity,\n sparsity_weight = cfg.sparsity_weight,\n hidden_activation = cfg.hidden_activation,\n reconstruct_activation = reconstruct_activation)\n self.dA_layers.append(dA_layer)", "metadata": "root.SdA.__init__", "header": "['class', 'SdA', '(', 'object', ')', ':', '___EOS___']", "index": 33 }, { "content": " def pretraining_functions(self, train_set_x, batch_size):\n\n # index to a [mini]batch\n index = T.lscalar('index') # index to a minibatch\n corruption_level = T.scalar('corruption') # % of corruption to use\n learning_rate = T.scalar('lr') # learning rate to use\n momentum = T.scalar('momentum')\n # number of batches\n n_batches = train_set_x.get_value(borrow=True).shape[0] / batch_size\n # begining of a batch, given `index`\n batch_begin = index * batch_size\n # ending of a batch given `index`\n batch_end = batch_begin + batch_size\n\n pretrain_fns = []\n for dA in self.dA_layers:\n # get the cost and the updates list\n cost, updates = dA.get_cost_updates(corruption_level, learning_rate, momentum)\n # compile the theano function\n fn = theano.function(inputs=[index,\n theano.Param(corruption_level, default=0.2),\n theano.Param(learning_rate, default=0.1),\n theano.Param(momentum, default=0.5)],\n outputs=cost,\n updates=updates,\n givens={self.x: train_set_x[batch_begin:batch_end]})\n # append `fn` to the list of functions\n pretrain_fns.append(fn)\n return pretrain_fns", "metadata": "root.SdA.pretraining_functions", "header": "['class', 'SdA', '(', 'object', ')', ':', '___EOS___']", "index": 76 }, { "content": "class SdA_maxout(object):\n\n", "metadata": "root.SdA_maxout", "header": "['module', '___EOS___']", "index": 109 }, { "content": " def __init__(self, numpy_rng, theano_rng=None, n_ins=784,\n hidden_layers_sizes=[500, 500], n_outs=10,\n corruption_levels=[0.1, 0.1], pool_size = 3,\n sparsity = None, sparsity_weight = None,\n first_reconstruct_activation = T.tanh):\n\n self.sigmoid_layers = []\n self.dA_layers = []\n self.params = []\n self.n_layers = len(hidden_layers_sizes)\n\n assert self.n_layers > 0\n\n if not theano_rng:\n theano_rng = RandomStreams(numpy_rng.randint(2 ** 30))\n # allocate symbolic variables for the data\n self.x = T.matrix('x')\n self.y = T.ivector('y')\n\n for i in xrange(self.n_layers):\n # construct the sigmoidal layer\n\n # the size of the input is either the number of hidden units of\n # the layer below or the input size if we are on the first layer\n if i == 0:\n input_size = n_ins\n else:\n input_size = hidden_layers_sizes[i - 1]\n\n # the input to this layer is either the activation of the hidden\n # layer below or the input of the SdA if you are on the first\n # layer\n if i == 0:\n layer_input = self.x\n else:\n layer_input = self.sigmoid_layers[-1].output\n\n sigmoid_layer = HiddenLayer(rng=numpy_rng,\n input=layer_input,\n n_in=input_size,\n n_out=hidden_layers_sizes[i] * pool_size,\n activation=(lambda x: 1.0*x),\n do_maxout = True, pool_size = pool_size)\n # add the layer to our list of layers\n self.sigmoid_layers.append(sigmoid_layer)\n\n self.params.extend(sigmoid_layer.params)\n\n # Construct a denoising autoencoder that shared weights with this layer\n if i == 0:\n reconstruct_activation = first_reconstruct_activation\n else:\n reconstruct_activation = (lambda x: 1.0*x)\n# reconstruct_activation = first_reconstruct_activation\n dA_layer = dA_maxout(numpy_rng=numpy_rng,\n theano_rng=theano_rng,\n input=layer_input,\n n_visible=input_size,\n n_hidden=hidden_layers_sizes[i] * pool_size,\n W=sigmoid_layer.W,\n bhid=sigmoid_layer.b,\n sparsity = sparsity,\n sparsity_weight = sparsity_weight,\n pool_size = pool_size,\n reconstruct_activation = reconstruct_activation)\n self.dA_layers.append(dA_layer)\n\n # We now need to add a logistic layer on top of the MLP\n self.logLayer = LogisticRegression(\n input=self.sigmoid_layers[-1].output,\n n_in=hidden_layers_sizes[-1], n_out=n_outs)\n\n self.sigmoid_layers.append(self.logLayer)\n self.params.extend(self.logLayer.params)\n # construct a function that implements one step of finetunining", "metadata": "root.SdA_maxout.__init__", "header": "['class', 'SdA_maxout', '(', 'object', ')', ':', '___EOS___']", "index": 111 }, { "content": " def pretraining_functions(self, train_set_x, batch_size):\n\n # index to a [mini]batch\n index = T.lscalar('index') # index to a minibatch\n corruption_level = T.scalar('corruption') # % of corruption to use\n learning_rate = T.scalar('lr') # learning rate to use\n # number of batches\n n_batches = train_set_x.get_value(borrow=True).shape[0] / batch_size\n # begining of a batch, given `index`\n batch_begin = index * batch_size\n # ending of a batch given `index`\n batch_end = batch_begin + batch_size\n\n pretrain_fns = []\n for dA in self.dA_layers:\n # get the cost and the updates list\n cost, updates = dA.get_cost_updates(corruption_level,\n learning_rate)\n # compile the theano function\n fn = theano.function(inputs=[index,\n theano.Param(corruption_level, default=0.2),\n theano.Param(learning_rate, default=0.1)],\n outputs=cost,\n updates=updates,\n givens={self.x: train_set_x[batch_begin:\n batch_end]})\n # append `fn` to the list of functions\n pretrain_fns.append(fn)\n\n return pretrain_fns", "metadata": "root.SdA_maxout.pretraining_functions", "header": "['class', 'SdA_maxout', '(', 'object', ')', ':', '___EOS___']", "index": 187 } ]
[ { "span": "import cPickle", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 14 }, { "span": "import gzip", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 11 }, { "span": "import os", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 9 }, { "span": "import sys", "start_line": 18, "start_column": 0, "end_line": 18, "end_column": 10 }, { "span": "import time", "start_line": 19, "start_column": 0, "end_line": 19, "end_column": 11 }, { "span": "import numpy", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 12 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "2013", " ", " ", " ", " ", "Ya", "jie", " ", "Mi", "ao", " ", " ", " ", " ", "Car", "neg", "ie", " ", "Mel", "lon", " ", "Univers", "ity_", "\\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_", "#", " ", "THIS", " ", "CODE", " ", "IS", " ", "PROVI", "DED", " ", "*", "AS", " ", "IS", "*", " ", "BAS", "IS", ",", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "KIND", ",", " ", "EI", "THER", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", ",", " ", "INC", "LU", "DING", " ", "WITH", "OUT", " ", "LIMIT", "ATION", " ", "ANY", " ", "IMPL", "IED", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "TIT", "LE", ",", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "MER", "CHAN", "TAB", "LIT", "Y", " ", "OR", " ", "NON", "-", "INF", "RING", "EME", "NT", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "the", " ", "Ap", "ache", " ", "2", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "c", "Pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "gzip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "numpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "theano_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "theano_", "._", "tensor_", "as_", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "theano_", "._", "tensor_", "._", "shared", "\\u", "random", "streams_", "import_", "Random", "Stream", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "layers_", "._", "logistic", "\\u", "sgd", "_", "import_", "Logi", "stic", "Regression_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "layers_", "._", "mlp", "_", "import_", "Hi", "dde", "n", "Layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "layers_", "._", "da_", "import_", "d", "A_", ",_", "d", "A", "\\u", "max", "out_", "\\u\\u\\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_", "#", " ", "an", " ", "outdate", "d", " ", "class", " ", "for", " ", "Sd", "A", " ", "with", " ", "max", "out", " ", "hidden", " ", "activation", ".", " ", "pre", "-", "train", "ing", " ", "has", " ", "bee", "n", " ", "expir", "ical", "ly", " ", "found", " ", "to", " ", "be_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NOT", " ", "help", "ful", " ", "for", " ", "max", "out", " ", "network", "s", ",", " ", "so", " ", "we", " ", "don", "'", "t", " ", "update", " ", "this", " ", "class_", "\\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_", "Sd", "A_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Sd", "A_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "nump", "y", "\\u", "rng_", ",_", "theano", "\\u", "rng_", "=_", "None_", ",_", "cfg_", "=_", "None_", ",_", "dnn", "_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Stack", "ed", " ", "Den", "ois", "ing", " ", "Auto", "encoders", " ", "for", " ", "DNN", " ", "Pre", "-", "train", "ing", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cfg_", "=_", "cfg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hidden", "\\u", "layer", "s", "\\u", "sizes_", "=_", "cfg_", "._", "hidden", "\\u", "layer", "s", "\\u", "sizes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "n", "\\u", "ins_", "=_", "cfg_", "._", "n", "\\u", "ins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "hidden", "\\u", "layer", "s", "\\u", "number_", "=_", "len_", "(_", "self_", "._", "hidden", "\\u", "layer", "s", "\\u", "sizes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "d", "A", "\\u", "layers_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "theano", "\\u", "rng_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "theano", "\\u", "rng_", "=_", "Random", "Stream", "s_", "(_", "nump", "y", "\\u", "rng_", "._", "randint_", "(_", "2_", "**_", "30_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "allocate", " ", "symbolic", " ", "variab", "les", " ", "for", " ", "the", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "x_", "=_", "dnn", "_", "._", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "self_", "._", "hidden", "\\u", "layer", "s", "\\u", "number_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "size", " ", "of", " ", "the", " ", "input", " ", "is", " ", "eit", "her", " ", "the", " ", "number", " ", "of", " ", "hidden", " ", "unit", "s", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "layer", " ", "belo", "w", ",", " ", "or", " ", "the", " ", "input", " ", "size", " ", "if", " ", "we", " ", "are", " ", "on", " ", "the", " ", "first", " ", "layer_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input", "\\u", "size_", "=_", "self_", "._", "n", "\\u", "ins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layer", "\\u", "input_", "=_", "self_", "._", "x_", "\\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 ", " _", "input", "\\u", "size_", "=_", "self_", "._", "hidden", "\\u", "layer", "s", "\\u", "sizes_", "[_", "i_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "layer", "\\u", "input_", "=_", "dnn", "_", "._", "layers_", "[_", "i_", "-_", "1_", "]_", "._", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Construct", " ", "a", " ", "deno", "ising", " ", "autoe", "ncode", "r", " ", "tha", "t", " ", "shared", " ", "weight", "s", " ", "with", " ", "this", " ", "layer_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "i_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reconstruct", "\\u", "activation_", "=_", "cfg_", "._", "firstl", "aye", "r", "\\u", "reconstruct", "\\u", "activation_", "\\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 ", " _", "reconstruct", "\\u", "activation_", "=_", "cfg_", "._", "hidden", "\\u", "activation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d", "A", "\\u", "layer_", "=_", "d", "A_", "(_", "nump", "y", "\\u", "rng_", "=_", "nump", "y", "\\u", "rng_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "theano", "\\u", "rng_", "=_", "theano", "\\u", "rng_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "input_", "=_", "layer", "\\u", "input_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "visible_", "=_", "input", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "hidden_", "=_", "self_", "._", "hidden", "\\u", "layer", "s", "\\u", "sizes_", "[_", "i_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "W_", "=_", "dnn", "_", "._", "layers_", "[_", "i_", "]_", "._", "W_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bh", "id_", "=_", "dnn", "_", "._", "layers_", "[_", "i_", "]_", "._", "b_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sparsity", "_", "=_", "cfg_", "._", "sparsity", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sparsity", "\\u", "weight_", "=_", "cfg_", "._", "sparsity", "\\u", "weight_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "hidden", "\\u", "activation_", "=_", "cfg_", "._", "hidden", "\\u", "activation_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reconstruct", "\\u", "activation_", "=_", "reconstruct", "\\u", "activation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "d", "A", "\\u", "layers_", "._", "append_", "(_", "d", "A", "\\u", "layer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sd", "A_", "(_", "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_", "pretr", "ain", "ing", "\\u", "functions_", "(_", "self_", ",_", "train", "\\u", "set\\u", "x_", ",_", "batch", "\\u", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "index", " ", "to", " ", "a", " ", "[", "mini", "]", "batch_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "index_", "=_", "T_", "._", "lsc", "ala", "r_", "(_", "'", "index", "'_", ")_", "#", " ", "index", " ", "to", " ", "a", " ", "minibatch", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "corrupt", "ion", "\\u", "level_", "=_", "T_", "._", "scalar_", "(_", "'", "corrupt", "ion", "'_", ")_", "#", " ", "%", " ", "of", " ", "corrupt", "ion", " ", "to", " ", "use_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "ing", "\\u", "rate_", "=_", "T_", "._", "scalar_", "(_", "'", "lr", "'_", ")_", "#", " ", "learn", "ing", " ", "rate", " ", "to", " ", "use_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "momentum_", "=_", "T_", "._", "scalar_", "(_", "'", "moment", "um", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "number", " ", "of", " ", "batches_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "batches_", "=_", "train", "\\u", "set\\u", "x_", "._", "get", "\\u", "value_", "(_", "borrow", "_", "=_", "True_", ")_", "._", "shape_", "[_", "0_", "]_", "/_", "batch", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "begin", "ing", " ", "of", " ", "a", " ", "batch", ",", " ", "give", "n", " ", "`", "index", "`_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "begin_", "=_", "index_", "*_", "batch", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "ending", " ", "of", " ", "a", " ", "batch", " ", "give", "n", " ", "`", "index", "`_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "end_", "=_", "batch", "\\u", "begin_", "+_", "batch", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pretr", "ain", "\\u", "fns_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d", "A_", "in_", "self_", "._", "d", "A", "\\u", "layers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "cost", " ", "and", " ", "the", " ", "update", "s", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cost_", ",_", "updates_", "=_", "d", "A_", "._", "get", "\\u", "cost", "\\u", "updates_", "(_", "corrupt", "ion", "\\u", "level_", ",_", "learn", "ing", "\\u", "rate_", ",_", "momentum_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "compile", " ", "the", " ", "theano", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "fn_", "=_", "theano_", "._", "function_", "(_", "inputs_", "=_", "[_", "index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "theano_", "._", "Param_", "(_", "corrupt", "ion", "\\u", "level_", ",_", "default_", "=_", "0.2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "theano_", "._", "Param_", "(_", "learn", "ing", "\\u", "rate_", ",_", "default_", "=_", "0.1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "theano_", "._", "Param_", "(_", "momentum_", ",_", "default_", "=_", "0.5_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "cost_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "updates_", "=_", "updates_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "give", "ns_", "=_", "{_", "self_", "._", "x_", ":_", "train", "\\u", "set\\u", "x_", "[_", "batch", "\\u", "begin_", ":_", "batch", "\\u", "end_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "append", " ", "`", "fn", "`", " ", "to", " ", "the", " ", "list", " ", "of", " ", "functions_", "\\u\\u\\uNL\\u\\u\\u_", "pretr", "ain", "\\u", "fns_", "._", "append_", "(_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "pretr", "ain", "\\u", "fns_", "\\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_", "Sd", "A", "\\u", "max", "out_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Sd", "A", "\\u", "max", "out_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "nump", "y", "\\u", "rng_", ",_", "theano", "\\u", "rng_", "=_", "None_", ",_", "n", "\\u", "ins_", "=_", "784", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "hidden", "\\u", "layer", "s", "\\u", "sizes_", "=_", "[_", "500_", ",_", "500_", "]_", ",_", "n", "\\u", "outs_", "=_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "corrupt", "ion", "\\u", "levels_", "=_", "[_", "0.1_", ",_", "0.1_", "]_", ",_", "pool", "\\u", "size_", "=_", "3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sparsity", "_", "=_", "None_", ",_", "sparsity", "\\u", "weight_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "first", "\\u", "reconstruct", "\\u", "activation_", "=_", "T_", "._", "tanh_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "sigm", "oid", "\\u", "layers_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "d", "A", "\\u", "layers_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "params_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "n", "\\u", "layers_", "=_", "len_", "(_", "hidden", "\\u", "layer", "s", "\\u", "sizes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "self_", "._", "n", "\\u", "layers_", ">_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "theano", "\\u", "rng_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "theano", "\\u", "rng_", "=_", "Random", "Stream", "s_", "(_", "nump", "y", "\\u", "rng_", "._", "randint_", "(_", "2_", "**_", "30_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "allocate", " ", "symbolic", " ", "variab", "les", " ", "for", " ", "the", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "x_", "=_", "T_", "._", "matrix_", "(_", "'", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "y_", "=_", "T_", "._", "ive", "ctor_", "(_", "'", "y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "xrange_", "(_", "self_", "._", "n", "\\u", "layers_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "construct", " ", "the", " ", "sigm", "oid", "al", " ", "layer_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "size", " ", "of", " ", "the", " ", "input", " ", "is", " ", "eit", "her", " ", "the", " ", "number", " ", "of", " ", "hidden", " ", "unit", "s", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "layer", " ", "belo", "w", " ", "or", " ", "the", " ", "input", " ", "size", " ", "if", " ", "we", " ", "are", " ", "on", " ", "the", " ", "first", " ", "layer_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "input", "\\u", "size_", "=_", "n", "\\u", "ins_", "\\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 ", " _", "input", "\\u", "size_", "=_", "hidden", "\\u", "layer", "s", "\\u", "sizes_", "[_", "i_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "input", " ", "to", " ", "this", " ", "layer", " ", "is", " ", "eit", "her", " ", "the", " ", "activation", " ", "of", " ", "the", " ", "hidden_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "layer", " ", "belo", "w", " ", "or", " ", "the", " ", "input", " ", "of", " ", "the", " ", "Sd", "A", " ", "if", " ", "you", " ", "are", " ", "on", " ", "the", " ", "first_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "layer_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "i_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "layer", "\\u", "input_", "=_", "self_", "._", "x_", "\\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 ", " _", "layer", "\\u", "input_", "=_", "self_", "._", "sigm", "oid", "\\u", "layers_", "[_", "-_", "1_", "]_", "._", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sigm", "oid", "\\u", "layer_", "=_", "Hi", "dde", "n", "Layer_", "(_", "rng_", "=_", "nump", "y", "\\u", "rng_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "input_", "=_", "layer", "\\u", "input_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "in_", "=_", "input", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "out_", "=_", "hidden", "\\u", "layer", "s", "\\u", "sizes_", "[_", "i_", "]_", "*_", "pool", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "activation_", "=_", "(_", "lambda_", "x_", ":_", "1.0_", "*_", "x_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "do", "\\u", "max", "out_", "=_", "True_", ",_", "pool", "\\u", "size_", "=_", "pool", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "the", " ", "layer", " ", "to", " ", "our", " ", "list", " ", "of", " ", "layers_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "sigm", "oid", "\\u", "layers_", "._", "append_", "(_", "sigm", "oid", "\\u", "layer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "params_", "._", "extend_", "(_", "sigm", "oid", "\\u", "layer_", "._", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Construct", " ", "a", " ", "deno", "ising", " ", "autoe", "ncode", "r", " ", "tha", "t", " ", "shared", " ", "weight", "s", " ", "with", " ", "this", " ", "layer_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "i_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reconstruct", "\\u", "activation_", "=_", "first", "\\u", "reconstruct", "\\u", "activation_", "\\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 ", " _", "reconstruct", "\\u", "activation_", "=_", "(_", "lambda_", "x_", ":_", "1.0_", "*_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", "reconstruct", "\\u", "activation", " ", "=", " ", "first", "\\u", "reconstruct", "\\u", "activation_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "d", "A", "\\u", "layer_", "=_", "d", "A", "\\u", "max", "out_", "(_", "nump", "y", "\\u", "rng_", "=_", "nump", "y", "\\u", "rng_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "theano", "\\u", "rng_", "=_", "theano", "\\u", "rng_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "input_", "=_", "layer", "\\u", "input_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "visible_", "=_", "input", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "hidden_", "=_", "hidden", "\\u", "layer", "s", "\\u", "sizes_", "[_", "i_", "]_", "*_", "pool", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "W_", "=_", "sigm", "oid", "\\u", "layer_", "._", "W_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bh", "id_", "=_", "sigm", "oid", "\\u", "layer_", "._", "b_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sparsity", "_", "=_", "sparsity", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sparsity", "\\u", "weight_", "=_", "sparsity", "\\u", "weight_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pool", "\\u", "size_", "=_", "pool", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reconstruct", "\\u", "activation_", "=_", "reconstruct", "\\u", "activation_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "d", "A", "\\u", "layers_", "._", "append_", "(_", "d", "A", "\\u", "layer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "now", " ", "need", " ", "to", " ", "add", " ", "a", " ", "logistic", " ", "layer", " ", "on", " ", "top", " ", "of", " ", "the", " ", "MLP", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "log", "Layer_", "=_", "Logi", "stic", "Regression_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "input_", "=_", "self_", "._", "sigm", "oid", "\\u", "layers_", "[_", "-_", "1_", "]_", "._", "output_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "in_", "=_", "hidden", "\\u", "layer", "s", "\\u", "sizes_", "[_", "-_", "1_", "]_", ",_", "n", "\\u", "out_", "=_", "n", "\\u", "outs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "sigm", "oid", "\\u", "layers_", "._", "append_", "(_", "self_", "._", "log", "Layer_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "params_", "._", "extend_", "(_", "self_", "._", "log", "Layer_", "._", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "construct", " ", "a", " ", "function", " ", "tha", "t", " ", "implement", "s", " ", "one", " ", "step", " ", "of", " ", "fine", "tun", "inin", "g_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Sd", "A", "\\u", "max", "out_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pretr", "ain", "ing", "\\u", "functions_", "(_", "self_", ",_", "train", "\\u", "set\\u", "x_", ",_", "batch", "\\u", "size_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "index", " ", "to", " ", "a", " ", "[", "mini", "]", "batch_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "index_", "=_", "T_", "._", "lsc", "ala", "r_", "(_", "'", "index", "'_", ")_", "#", " ", "index", " ", "to", " ", "a", " ", "minibatch", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "corrupt", "ion", "\\u", "level_", "=_", "T_", "._", "scalar_", "(_", "'", "corrupt", "ion", "'_", ")_", "#", " ", "%", " ", "of", " ", "corrupt", "ion", " ", "to", " ", "use_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "learn", "ing", "\\u", "rate_", "=_", "T_", "._", "scalar_", "(_", "'", "lr", "'_", ")_", "#", " ", "learn", "ing", " ", "rate", " ", "to", " ", "use_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "number", " ", "of", " ", "batches_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "batches_", "=_", "train", "\\u", "set\\u", "x_", "._", "get", "\\u", "value_", "(_", "borrow", "_", "=_", "True_", ")_", "._", "shape_", "[_", "0_", "]_", "/_", "batch", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "begin", "ing", " ", "of", " ", "a", " ", "batch", ",", " ", "give", "n", " ", "`", "index", "`_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "begin_", "=_", "index_", "*_", "batch", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "ending", " ", "of", " ", "a", " ", "batch", " ", "give", "n", " ", "`", "index", "`_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "end_", "=_", "batch", "\\u", "begin_", "+_", "batch", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pretr", "ain", "\\u", "fns_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "d", "A_", "in_", "self_", "._", "d", "A", "\\u", "layers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "cost", " ", "and", " ", "the", " ", "update", "s", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cost_", ",_", "updates_", "=_", "d", "A_", "._", "get", "\\u", "cost", "\\u", "updates_", "(_", "corrupt", "ion", "\\u", "level_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "learn", "ing", "\\u", "rate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "compile", " ", "the", " ", "theano", " ", "function_", "\\u\\u\\uNL\\u\\u\\u_", "fn_", "=_", "theano_", "._", "function_", "(_", "inputs_", "=_", "[_", "index_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "theano_", "._", "Param_", "(_", "corrupt", "ion", "\\u", "level_", ",_", "default_", "=_", "0.2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "theano_", "._", "Param_", "(_", "learn", "ing", "\\u", "rate_", ",_", "default_", "=_", "0.1_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "cost_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "updates_", "=_", "updates_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "give", "ns_", "=_", "{_", "self_", "._", "x_", ":_", "train", "\\u", "set\\u", "x_", "[_", "batch", "\\u", "begin_", ":_", "\\u\\u\\uNL\\u\\u\\u_", "batch", "\\u", "end_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "append", " ", "`", "fn", "`", " ", "to", " ", "the", " ", "list", " ", "of", " ", "functions_", "\\u\\u\\uNL\\u\\u\\u_", "pretr", "ain", "\\u", "fns_", "._", "append_", "(_", "fn_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "pretr", "ain", "\\u", "fns_" ]
[ 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
opencollab/debile/tests/test_flake8.py
[ { "content": " def test_flake8(self):\n flake8_analysis = flake8(self.filepath, self.firehose_results)\n content = flake8_analysis[1]\n self.assertTrue(\"missing whitespace around operator\" in content)\n\n # It think it is safe to say that the string is not 4 chars long\n self.assertTrue(len(content) > 4)", "metadata": "root.Flake8TestCase.test_flake8", "header": "['class', 'Flake8TestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 39 }, { "content": " def test_flake8_wrappers(self):\n flake8_analysis = flake8(self.filepath, self.firehose_results)\n issues = parse_flake8(flake8_analysis[1].splitlines())\n i = 0\n for issue in issues:\n if issue.location.file.givenpath == \"./firehose/parsers/cppcheck.py\" and \\\n issue.location.point.line==37 and issue.location.point.column==5:\n found = issue\n i += 1\n print found\n self.assertEquals(found.testid, \"F841\")\n self.assertEquals(found.location.file.givenpath,\n \"./firehose/parsers/cppcheck.py\")\n self.assertEquals(found.location.point.line, 37)\n self.assertEquals(found.location.point.column, 5)\n self.assertEquals(found.severity, \"error\")\n self.assertIsNone(found.notes)\n self.assertIsNone(found.customfields)\n self.assertTrue(\"F841 local variable 'version' is assigned to but never used\"\n in found.message.text)\n self.assertTrue(i > 100)", "metadata": "root.Flake8TestCase.test_flake8_wrappers", "header": "['class', 'Flake8TestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 48 } ]
[ { "span": "self.assertTrue(\"missing whitespace around operator\" in content)", "start_line": 42, "start_column": 8, "end_line": 42, "end_column": 72 }, { "span": "self.assertTrue(len(content) > 4)", "start_line": 45, "start_column": 8, "end_line": 45, "end_column": 41 }, { "span": "self.assertTrue(\"F841 local variable 'version' is assigned to but never used\"\n in found.message.text)", "start_line": 66, "start_column": 8, "end_line": 67, "end_column": 38 }, { "span": "self.assertTrue(i > 100)", "start_line": 68, "start_column": 8, "end_line": 68, "end_column": 32 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Fla", "ke", "8", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "flake", "8_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flake", "8", "\\u", "analysis_", "=_", "flake", "8_", "(_", "self_", "._", "filepath_", ",_", "self_", "._", "fire", "hos", "e\\u", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "flake", "8", "\\u", "analysis_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "missi", "ng", " ", "whitespace", " ", "aro", "und", " ", "opera", "tor", "\"_", "in_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "It", " ", "think", " ", "it", " ", "is", " ", "safe", " ", "to", " ", "say", " ", "tha", "t", " ", "the", " ", "string", " ", "is", " ", "not", " ", "4", " ", "char", "s", " ", "long_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "content_", ")_", ">_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Fla", "ke", "8", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "flake", "8", "\\u", "wrappers_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flake", "8", "\\u", "analysis_", "=_", "flake", "8_", "(_", "self_", "._", "filepath_", ",_", "self_", "._", "fire", "hos", "e\\u", "results_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "issues_", "=_", "parse", "\\u", "flake", "8_", "(_", "flake", "8", "\\u", "analysis_", "[_", "1_", "]_", "._", "splitlines_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "issue_", "in_", "issues_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "issue_", "._", "location_", "._", "file_", "._", "give", "npa", "th_", "==_", "\"./", "fire", "hos", "e", "/", "parser", "s", "/", "cpp", "check", ".", "py", "\"_", "and_", "issue_", "._", "location_", "._", "point_", "._", "line_", "==_", "37_", "and_", "issue_", "._", "location_", "._", "point_", "._", "column_", "==_", "5_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "found_", "=_", "issue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "found_", "._", "testi", "d_", ",_", "\"", "F8", "4", "1", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "found_", "._", "location_", "._", "file_", "._", "give", "npa", "th_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"./", "fire", "hos", "e", "/", "parser", "s", "/", "cpp", "check", ".", "py", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "found_", "._", "location_", "._", "point_", "._", "line_", ",_", "37_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "found_", "._", "location_", "._", "point_", "._", "column_", ",_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "found_", "._", "severity_", ",_", "\"", "error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "found_", "._", "notes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "None_", "(_", "found_", "._", "custom", "fields_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "\"", "F8", "4", "1", " ", "local", " ", "variab", "le", " ", "'", "version", "'", " ", "is", " ", "assign", "ed", " ", "to", " ",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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, 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, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1 ]
Unused import
QuantSoftware/QuantSoftwareToolkit/Examples/FeatureSearch/functions.py
[ { "content": "''' Python imports '''\nimport datetime as dt\n\n''' 3rd party imports '''\nimport numpy as np\nimport pandas as pand\nimport matplotlib.pyplot as plt\n\n''' QSTK imports '''\nfrom QSTK.qstkutil import DataAccess as da\nfrom QSTK.qstkutil import qsdateutil as du\n\nfrom QSTK.qstkfeat.features import featMA, featRSI, featDrawDown, featRunUp, featVolumeDelta, featAroon\nfrom QSTK.qstkfeat.classes import class_fut_ret\nimport QSTK.qstkfeat.featutil as ftu\t\n\t\nimport sys\n\nMAX_ITERATIONS = 500\n\t\n\n\t\t\t\n\n\n\n\t\n\t\n\n\t\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def learnerTest( naTrain, naTest ):\n\t#create the learner with the train set with K=5\n\tcLearn = ftu.createKnnLearner( naTrain, lKnn=5 )\n\t#get the Y values predicted by the learner\n\tYpredicted = cLearn.query( naTest[:,:-1] )\n\t#get the actual Y values\n\tY = naTest[:,-1]\n\t#calculate the correlation coefficient\n\tcorrcoef = np.corrcoef(Y,Ypredicted)[0][1]\n\t#return the corrcoef\n\treturn corrcoef\t", "metadata": "root.learnerTest", "header": "['module', '___EOS___']", "index": 20 }, { "content": "def nextBestFeature(naFeatTrain,naFeatTest,lSelectedFeatures,lRemainingFeatures,classLabelIndex):\n\tsys.stdout.write('nextBestFeature\\n')\n\t\n\tbestFeature = -1\n\tbestFeatureCorrCoef = 0\n\tfor x in lRemainingFeatures:\n\t\tlCurrentFeatureSet = [x]+lSelectedFeatures+[classLabelIndex]\n\t\tsys.stdout.write('testing feature set ' + str(lCurrentFeatureSet))\n\t\tcurrentTrain = naFeatTrain[:,lCurrentFeatureSet]\n\t\tcurrentTest = naFeatTest[:,lCurrentFeatureSet]\n\t\tcurrentCorrCoef = learnerTest(currentTrain,currentTest)\n\t\tsys.stdout.write(' :: corr coef = ' + str(currentCorrCoef) + '\\n')\n\t\tif bestFeature == -1 or bestFeatureCorrCoef < currentCorrCoef:\n\t\t\tbestFeature = x\n\t\t\tbestFeatureCorrCoef = currentCorrCoef\n\t\t\t\n\tsys.stdout.write('nextBestFeature: ' + str(bestFeature) + '\\n')\n\tsys.stdout.write('bestFeatureCorrCoef: ' + str(bestFeatureCorrCoef) + '\\n\\n')\n\treturn {'bestFeature':bestFeature,'bestFeatureCorrCoef':bestFeatureCorrCoef}", "metadata": "root.nextBestFeature", "header": "['module', '___EOS___']", "index": 32 }, { "content": "def nextWorstFeature(naFeatTrain,naFeatTest,lSelectedFeatures,classLabelIndex):\n\tsys.stdout.write('nextWorstFeature\\n')\n\n\tif len(lSelectedFeatures) == 1:\n\t\tsys.stdout.write('nextWorstFeature: ' + str(lSelectedFeatures[0]) + '\\n')\n\t\tsys.stdout.write('worstFeatureCorrCoef: ' + str(-999) + '\\n\\n')\n\t\treturn {'worstFeature':lSelectedFeatures[0],'worstFeatureCorrCoef':-999}\n\n\tworstFeature = -1\n\tworstFeatureCorrCoef = 0\n\tfor x in lSelectedFeatures:\n\t\tlSelectedFeaturesCopy = lSelectedFeatures[:]\n\t\tlSelectedFeaturesCopy.remove(x);\t\t\t\n\t\tlCurrentFeatureSet = lSelectedFeaturesCopy + [classLabelIndex]\n\t\tsys.stdout.write('testing feature set ' + str(lCurrentFeatureSet))\n\t\tcurrentTrain = naFeatTrain[:,lCurrentFeatureSet]\n\t\tcurrentTest = naFeatTest[:,lCurrentFeatureSet]\n\t\tcurrentCorrCoef = learnerTest(currentTrain,currentTest)\n\t\tsys.stdout.write(' :: corr coef = ' + str(currentCorrCoef) + '\\n')\n\t\tif worstFeature == -1 or worstFeatureCorrCoef < currentCorrCoef:\n\t\t\tworstFeature = x\n\t\t\tworstFeatureCorrCoef = currentCorrCoef\n\t\t\t\n\tsys.stdout.write('nextWorstFeature: ' + str(worstFeature) + '\\n')\n\tsys.stdout.write('worstFeatureCorrCoef: ' + str(worstFeatureCorrCoef) + '\\n\\n')\n\treturn {'worstFeature':worstFeature,'worstFeatureCorrCoef':worstFeatureCorrCoef}", "metadata": "root.nextWorstFeature", "header": "['module', '___EOS___']", "index": 52 }, { "content": "def sequentialForwardSelection(naFeatTrain,naFeatTest,lFeatures,classLabelIndex):\n\tlSelectedFeatures = list()\n\tlRemainingFeatures = lFeatures[:]\n\tlCorrCoef = list();\n\twhile len(lRemainingFeatures) > 0:\n\t\tsys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\\n')\n\t\tsys.stdout.write('lRemainingFeatures: ' + str(lRemainingFeatures) + '\\n')\n\t\tsys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\\n')\n\t\tretValue = nextBestFeature(naFeatTrain,naFeatTest,lSelectedFeatures,lRemainingFeatures,classLabelIndex)\n\t\tlSelectedFeatures.append(retValue['bestFeature'])\n\t\tlRemainingFeatures.remove(retValue['bestFeature'])\n\t\tlCorrCoef.append(retValue['bestFeatureCorrCoef'])\n\t\t\n\tmaxlCorrCoef = max(lCorrCoef)\n\tmaxlCorrCoefIndex = lCorrCoef.index(maxlCorrCoef)\n\tsys.stdout.write('best feature set is ' + str(lSelectedFeatures[0:maxlCorrCoefIndex+1]+[classLabelIndex]) + '\\n')\n\tsys.stdout.write('corr coef = ' + str(maxlCorrCoef))\n\treturn maxlCorrCoef", "metadata": "root.sequentialForwardSelection", "header": "['module', '___EOS___']", "index": 79 }, { "content": "def sequentialBackwardSelection(naFeatTrain,naFeatTest,lFeatures,classLabelIndex):\n\tlSelectedFeatures = lFeatures[:]\n\tlCorrCoef = list()\n\tlRemovedFeatures = list()\n\twhile len(lSelectedFeatures) > 0:\n\t\tsys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\\n')\n\t\tsys.stdout.write('lRemovedFeatures: ' + str(lRemovedFeatures) + '\\n')\n\t\tsys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\\n')\n\t\tretValue = nextWorstFeature(naFeatTrain,naFeatTest,lSelectedFeatures,classLabelIndex)\n\t\tlSelectedFeatures.remove(retValue['worstFeature'])\n\t\tlCorrCoef.append(retValue['worstFeatureCorrCoef'])\n\t\tlRemovedFeatures.append(retValue['worstFeature'])\n\t\t\n\tmaxlCorrCoef = max(lCorrCoef)\n\tmaxlCorrCoefIndex = lCorrCoef.index(maxlCorrCoef)\n\tlBestSet = list(set(lFeatures) - set(lRemovedFeatures[0:maxlCorrCoefIndex+1]))\n\tsys.stdout.write('best feature set is ' + str(lBestSet+[classLabelIndex]) + '\\n')\n\tsys.stdout.write('corr coef = ' + str(maxlCorrCoef))\n\treturn maxlCorrCoef", "metadata": "root.sequentialBackwardSelection", "header": "['module', '___EOS___']", "index": 98 }, { "content": "def sequentialFloatingForwardSelection(naFeatTrain,naFeatTest,lFeatures,classLabelIndex):\n\tglobal MAX_ITERATIONS\n\tlSelectedFeatures = list()\n\tlRemainingFeatures = lFeatures[:]\n\tlCorrCoef = list()\n\tlSeenStates = list()\n\twhile len(lRemainingFeatures) > 0:\n\t\tsys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\\n')\n\t\tsys.stdout.write('lRemainingFeatures: ' + str(lRemainingFeatures) + '\\n')\n\t\tsys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\\n')\n\t\tretValue = nextBestFeature(naFeatTrain,naFeatTest,lSelectedFeatures,lRemainingFeatures,classLabelIndex)\n\t\tlSelectedFeatures.append(retValue['bestFeature'])\n\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\tlRemainingFeatures.remove(retValue['bestFeature'])\n\t\tlCorrCoef.append(retValue['bestFeatureCorrCoef'])\n\t\twhile True:\n\t\t\tsys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\\n')\n\t\t\tsys.stdout.write('lRemainingFeatures: ' + str(lRemainingFeatures) + '\\n')\n\t\t\tsys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\\n')\n\t\t\tretValue2 = nextWorstFeature(naFeatTrain,naFeatTest,lSelectedFeatures,classLabelIndex)\n\t\t\tif lCorrCoef[-1] < retValue2['worstFeatureCorrCoef']:\n\t\t\t\tnewState = set(lSelectedFeatures)\n\t\t\t\tnewState.remove(retValue2['worstFeature'])\n\t\t\t\tif newState in lSeenStates:\n\t\t\t\t\tsys.stdout.write('feature not removed b/c state already seen. \\n\\n')\n\t\t\t\t\tbreak\n\t\t\t\tlSelectedFeatures.remove(retValue2['worstFeature'])\n\t\t\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\t\t\tlRemainingFeatures.append(retValue2['worstFeature'])\n\t\t\t\tlCorrCoef.append(retValue2['worstFeatureCorrCoef'])\n\t\t\telse:\n\t\t\t\tsys.stdout.write('feature not removed b/c corr not higher. \\n\\n')\n\t\t\t\tbreak\n\t\tif len(lSeenStates) >= MAX_ITERATIONS:\n\t\t\tsys.stdout.write('QUITTING B/C len(lSeenStates) >= MAX_ITERATIONS: ' + str(len(lSeenStates)) + '\\n\\n')\n\t\t\tbreak\n\t\n\tmaxlCorrCoef = max(lCorrCoef)\n\tmaxlCorrCoefIndex = lCorrCoef.index(maxlCorrCoef)\n\tsys.stdout.write('best feature set is ' + str(list(lSeenStates[maxlCorrCoefIndex])+[classLabelIndex]) + '\\n')\n\tsys.stdout.write('corr coef = ' + str(maxlCorrCoef))\n\treturn maxlCorrCoef", "metadata": "root.sequentialFloatingForwardSelection", "header": "['module', '___EOS___']", "index": 118 }, { "content": "def sequentialFloatingBackwardSelection(naFeatTrain,naFeatTest,lFeatures,classLabelIndex):\n\tglobal MAX_ITERATIONS\n\tlSelectedFeatures = lFeatures[:]\n\tlRemainingFeatures = list()\n\tlCorrCoef = list()\n\tlSeenStates = list()\n\twhile len(lSelectedFeatures) > 0:\n\t\tsys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\\n')\n\t\tsys.stdout.write('lRemainingFeatures: ' + str(lRemainingFeatures) + '\\n')\n\t\tsys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\\n')\n\t\tretValue = nextWorstFeature(naFeatTrain,naFeatTest,lSelectedFeatures,classLabelIndex)\n\t\tlSelectedFeatures.remove(retValue['worstFeature'])\n\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\tlRemainingFeatures.append(retValue['worstFeature'])\n\t\tlCorrCoef.append(retValue['worstFeatureCorrCoef'])\n\t\twhile True:\n\t\t\tsys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\\n')\n\t\t\tsys.stdout.write('lRemainingFeatures: ' + str(lRemainingFeatures) + '\\n')\n\t\t\tsys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\\n')\n\t\t\tretValue2 = nextBestFeature(naFeatTrain,naFeatTest,lSelectedFeatures,lRemainingFeatures,classLabelIndex)\n\t\t\tif lCorrCoef[-1] < retValue2['bestFeatureCorrCoef']:\n\t\t\t\tnewState = set(lSelectedFeatures)\n\t\t\t\tnewState.add(retValue2['bestFeature'])\n\t\t\t\tif newState in lSeenStates:\n\t\t\t\t\tsys.stdout.write('feature not added b/c state already seen. \\n\\n')\n\t\t\t\t\tbreak\n\t\t\t\tlSelectedFeatures.append(retValue2['bestFeature'])\n\t\t\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\t\t\tlRemainingFeatures.remove(retValue2['bestFeature'])\n\t\t\t\tlCorrCoef.append(retValue2['bestFeatureCorrCoef'])\n\t\t\telse:\n\t\t\t\tsys.stdout.write('feature not added b/c corr not higher. \\n\\n')\n\t\t\t\tbreak\n\t\tif len(lSeenStates) >= MAX_ITERATIONS:\n\t\t\tsys.stdout.write('QUITTING B/C len(lSeenStates) >= MAX_ITERATIONS: ' + str(len(lSeenStates)) + '\\n\\n')\n\t\t\tbreak\n\t\n\tmaxlCorrCoef = max(lCorrCoef)\n\tmaxlCorrCoefIndex = lCorrCoef.index(maxlCorrCoef)\n\tsys.stdout.write('best feature set is ' + str(list(lSeenStates[maxlCorrCoefIndex])+[classLabelIndex]) + '\\n')\n\tsys.stdout.write('corr coef = ' + str(maxlCorrCoef))\n\treturn maxlCorrCoef", "metadata": "root.sequentialFloatingBackwardSelection", "header": "['module', '___EOS___']", "index": 161 }, { "content": "def sequentialFloatingForwardSelectionNew(naFeatTrain,naFeatTest,lFeatures,classLabelIndex):\n\tglobal MAX_ITERATIONS\n\tlSelectedFeatures = list()\n\tlRemainingFeatures = lFeatures[:]\n\tlCorrCoef = list()\n\tlSeenStates = list()\n\t\n\tretValue = 0\n\twhile len(lRemainingFeatures) > 0:\n\t\tchange = False\n\t\twhile True:\n\t\t\tsys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\\n')\n\t\t\tsys.stdout.write('lRemainingFeatures: ' + str(lRemainingFeatures) + '\\n')\n\t\t\tsys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\\n')\n\t\t\tretValue = nextBestFeature(naFeatTrain,naFeatTest,lSelectedFeatures,lRemainingFeatures,classLabelIndex)\n\t\t\tif len(lCorrCoef)==0 or lCorrCoef[-1] < retValue['bestFeatureCorrCoef']:\n\t\t\t\tnewState = set(lSelectedFeatures)\n\t\t\t\tnewState.add(retValue['bestFeature'])\n\t\t\t\tif newState in lSeenStates:\n\t\t\t\t\tsys.stdout.write('feature not added b/c state already seen. \\n\\n')\n\t\t\t\t\tbreak\n\t\t\t\tlSelectedFeatures.append(retValue['bestFeature'])\n\t\t\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\t\t\tlRemainingFeatures.remove(retValue['bestFeature'])\n\t\t\t\tlCorrCoef.append(retValue['bestFeatureCorrCoef'])\n\t\t\telse:\n\t\t\t\tsys.stdout.write('feature not added b/c corr not higher. \\n\\n')\n\t\t\t\tbreak\n\t\twhile True:\n\t\t\tsys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\\n')\n\t\t\tsys.stdout.write('lRemainingFeatures: ' + str(lRemainingFeatures) + '\\n')\n\t\t\tsys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\\n')\n\t\t\tretValue2 = nextWorstFeature(naFeatTrain,naFeatTest,lSelectedFeatures,classLabelIndex)\n\t\t\tif lCorrCoef[-1] < retValue2['worstFeatureCorrCoef']:\n\t\t\t\tnewState = set(lSelectedFeatures)\n\t\t\t\tnewState.remove(retValue2['worstFeature'])\n\t\t\t\tif newState in lSeenStates:\n\t\t\t\t\tsys.stdout.write('feature not removed b/c state already seen. \\n\\n')\n\t\t\t\t\tbreak\n\t\t\t\tlSelectedFeatures.remove(retValue2['worstFeature'])\n\t\t\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\t\t\tlRemainingFeatures.append(retValue2['worstFeature'])\n\t\t\t\tlCorrCoef.append(retValue2['worstFeatureCorrCoef'])\n\t\t\t\tchange = True\n\t\t\telse:\n\t\t\t\tsys.stdout.write('feature not removed b/c corr not higher. \\n\\n')\n\t\t\t\tbreak\n\t\tif not change:\n\t\t\tlSelectedFeatures.append(retValue['bestFeature'])\n\t\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\t\tlRemainingFeatures.remove(retValue['bestFeature'])\n\t\t\tlCorrCoef.append(retValue['bestFeatureCorrCoef'])\n\t\t\tsys.stdout.write('feature added b/c no features were removed. \\n\\n')\n\t\t\t\n\t\tif len(lSeenStates) >= MAX_ITERATIONS:\n\t\t\tsys.stdout.write('QUITTING B/C len(lSeenStates) >= MAX_ITERATIONS: ' + str(len(lSeenStates)) + '\\n\\n')\n\t\t\tbreak\n\t\n\tmaxlCorrCoef = max(lCorrCoef)\n\tmaxlCorrCoefIndex = lCorrCoef.index(maxlCorrCoef)\n\tsys.stdout.write('best feature set is ' + str(list(lSeenStates[maxlCorrCoefIndex])+[classLabelIndex]) + '\\n')\n\tsys.stdout.write('corr coef = ' + str(maxlCorrCoef))\n\treturn maxlCorrCoef", "metadata": "root.sequentialFloatingForwardSelectionNew", "header": "['module', '___EOS___']", "index": 204 }, { "content": "def sequentialFloatingBackwardSelectionNew(naFeatTrain,naFeatTest,lFeatures,classLabelIndex):\n\tglobal MAX_ITERATIONS\n\tlSelectedFeatures = lFeatures[:]\n\tlRemainingFeatures = list()\n\tlCorrCoef = list()\n\tlSeenStates = list()\n\t\n\tretValue = 0\n\twhile len(lSelectedFeatures) > 0:\n\t\tchange = False\n\t\twhile True:\n\t\t\tsys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\\n')\n\t\t\tsys.stdout.write('lRemainingFeatures: ' + str(lRemainingFeatures) + '\\n')\n\t\t\tsys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\\n')\n\t\t\tretValue = nextWorstFeature(naFeatTrain,naFeatTest,lSelectedFeatures,classLabelIndex)\n\t\t\tif len(lCorrCoef)==0 or lCorrCoef[-1] < retValue['worstFeatureCorrCoef']:\n\t\t\t\tnewState = set(lSelectedFeatures)\n\t\t\t\tnewState.remove(retValue['worstFeature'])\n\t\t\t\tif newState in lSeenStates:\n\t\t\t\t\tsys.stdout.write('feature not removed b/c state already seen. \\n\\n')\n\t\t\t\t\tbreak\n\t\t\t\tlSelectedFeatures.remove(retValue['worstFeature'])\n\t\t\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\t\t\tlRemainingFeatures.append(retValue['worstFeature'])\n\t\t\t\tlCorrCoef.append(retValue['worstFeatureCorrCoef'])\n\t\t\telse:\n\t\t\t\tsys.stdout.write('feature not removed b/c corr not higher. \\n\\n')\n\t\t\t\tbreak\n\t\twhile True:\n\t\t\tsys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\\n')\n\t\t\tsys.stdout.write('lRemainingFeatures: ' + str(lRemainingFeatures) + '\\n')\n\t\t\tsys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\\n')\n\t\t\tretValue2 = nextBestFeature(naFeatTrain,naFeatTest,lSelectedFeatures,lRemainingFeatures,classLabelIndex)\n\t\t\tif lCorrCoef[-1] < retValue2['bestFeatureCorrCoef']:\n\t\t\t\tnewState = set(lSelectedFeatures)\n\t\t\t\tnewState.add(retValue2['bestFeature'])\n\t\t\t\tif newState in lSeenStates:\n\t\t\t\t\tsys.stdout.write('feature not added b/c state already seen. \\n\\n')\n\t\t\t\t\tbreak\n\t\t\t\tlSelectedFeatures.append(retValue2['bestFeature'])\n\t\t\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\t\t\tlRemainingFeatures.remove(retValue2['bestFeature'])\n\t\t\t\tlCorrCoef.append(retValue2['bestFeatureCorrCoef'])\n\t\t\t\tchange = True\n\t\t\telse:\n\t\t\t\tsys.stdout.write('feature not added b/c corr not higher. \\n\\n')\n\t\t\t\tbreak\n\t\tif not change:\n\t\t\tlSelectedFeatures.remove(retValue['worstFeature'])\n\t\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\t\tlRemainingFeatures.append(retValue['worstFeature'])\n\t\t\tlCorrCoef.append(retValue['worstFeatureCorrCoef'])\n\t\t\tsys.stdout.write('feature removed b/c no features were added. \\n\\n')\n\t\t\t\n\t\tif len(lSeenStates) >= MAX_ITERATIONS:\n\t\t\tsys.stdout.write('QUITTING B/C len(lSeenStates) >= MAX_ITERATIONS: ' + str(len(lSeenStates)) + '\\n\\n')\n\t\t\tbreak\n\t\n\tmaxlCorrCoef = max(lCorrCoef)\n\tmaxlCorrCoefIndex = lCorrCoef.index(maxlCorrCoef)\n\tsys.stdout.write('best feature set is ' + str(list(lSeenStates[maxlCorrCoefIndex])+[classLabelIndex]) + '\\n')\n\tsys.stdout.write('corr coef = ' + str(maxlCorrCoef))\n\treturn maxlCorrCoef", "metadata": "root.sequentialFloatingBackwardSelectionNew", "header": "['module', '___EOS___']", "index": 268 }, { "content": "def sequentialFloatingForwardSelectionNew_Max(naFeatTrain,naFeatTest,lFeatures,classLabelIndex):\n\tglobal MAX_ITERATIONS\n\tlSelectedFeatures = list()\n\tlRemainingFeatures = lFeatures[:]\n\tlCorrCoef = list()\n\tlSeenStates = list()\n\tmaxCorrCoef = -100\n\t\n\tretValue = 0\n\twhile len(lRemainingFeatures) > 0:\n\t\tchange = False\n\t\twhile True:\n\t\t\tsys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\\n')\n\t\t\tsys.stdout.write('lRemainingFeatures: ' + str(lRemainingFeatures) + '\\n')\n\t\t\tsys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\\n')\n\t\t\tretValue = nextBestFeature(naFeatTrain,naFeatTest,lSelectedFeatures,lRemainingFeatures,classLabelIndex)\n\t\t\tif len(lCorrCoef)==0 or maxCorrCoef < retValue['bestFeatureCorrCoef']:\n\t\t\t\tnewState = set(lSelectedFeatures)\n\t\t\t\tnewState.add(retValue['bestFeature'])\n\t\t\t\tif newState in lSeenStates:\n\t\t\t\t\tsys.stdout.write('feature not added b/c state already seen. \\n\\n')\n\t\t\t\t\tbreak\n\t\t\t\tlSelectedFeatures.append(retValue['bestFeature'])\n\t\t\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\t\t\tlRemainingFeatures.remove(retValue['bestFeature'])\n\t\t\t\tlCorrCoef.append(retValue['bestFeatureCorrCoef'])\n\t\t\t\tmaxCorrCoef = max(maxCorrCoef,retValue['bestFeatureCorrCoef'])\n\t\t\telse:\n\t\t\t\tsys.stdout.write('feature not added b/c corr not higher. \\n\\n')\n\t\t\t\tbreak\n\t\twhile True:\n\t\t\tsys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\\n')\n\t\t\tsys.stdout.write('lRemainingFeatures: ' + str(lRemainingFeatures) + '\\n')\n\t\t\tsys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\\n')\n\t\t\tretValue2 = nextWorstFeature(naFeatTrain,naFeatTest,lSelectedFeatures,classLabelIndex)\n\t\t\tif maxCorrCoef < retValue2['worstFeatureCorrCoef']:\n\t\t\t\tnewState = set(lSelectedFeatures)\n\t\t\t\tnewState.remove(retValue2['worstFeature'])\n\t\t\t\tif newState in lSeenStates:\n\t\t\t\t\tsys.stdout.write('feature not removed b/c state already seen. \\n\\n')\n\t\t\t\t\tbreak\n\t\t\t\tlSelectedFeatures.remove(retValue2['worstFeature'])\n\t\t\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\t\t\tlRemainingFeatures.append(retValue2['worstFeature'])\n\t\t\t\tlCorrCoef.append(retValue2['worstFeatureCorrCoef'])\n\t\t\t\tmaxCorrCoef = max(maxCorrCoef,retValue2['worstFeatureCorrCoef'])\n\t\t\t\tchange = True\n\t\t\telse:\n\t\t\t\tsys.stdout.write('feature not removed b/c corr not higher. \\n\\n')\n\t\t\t\tbreak\n\t\tif not change:\n\t\t\tlSelectedFeatures.append(retValue['bestFeature'])\n\t\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\t\tlRemainingFeatures.remove(retValue['bestFeature'])\n\t\t\tlCorrCoef.append(retValue['bestFeatureCorrCoef'])\n\t\t\tmaxCorrCoef = max(maxCorrCoef,retValue['bestFeatureCorrCoef'])\n\t\t\tsys.stdout.write('feature added b/c no features were removed. \\n\\n')\n\t\t\t\n\t\tif len(lSeenStates) >= MAX_ITERATIONS:\n\t\t\tsys.stdout.write('QUITTING B/C len(lSeenStates) >= MAX_ITERATIONS: ' + str(len(lSeenStates)) + '\\n\\n')\n\t\t\tbreak\n\t\n\tmaxlCorrCoef = max(lCorrCoef)\n\tmaxlCorrCoefIndex = lCorrCoef.index(maxlCorrCoef)\n\tsys.stdout.write('best feature set is ' + str(list(lSeenStates[maxlCorrCoefIndex])+[classLabelIndex]) + '\\n')\n\tsys.stdout.write('corr coef = ' + str(maxlCorrCoef))\n\treturn maxlCorrCoef", "metadata": "root.sequentialFloatingForwardSelectionNew_Max", "header": "['module', '___EOS___']", "index": 332 }, { "content": "def sequentialFloatingBackwardSelectionNew_Max(naFeatTrain,naFeatTest,lFeatures,classLabelIndex):\n\tglobal MAX_ITERATIONS\n\tlSelectedFeatures = lFeatures[:]\n\tlRemainingFeatures = list()\n\tlCorrCoef = list()\n\tlSeenStates = list()\n\tmaxCorrCoef = -100\n\t\n\tretValue = 0\n\twhile len(lSelectedFeatures) > 0:\n\t\tchange = False\n\t\twhile True:\n\t\t\tsys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\\n')\n\t\t\tsys.stdout.write('lRemainingFeatures: ' + str(lRemainingFeatures) + '\\n')\n\t\t\tsys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\\n')\n\t\t\tretValue = nextWorstFeature(naFeatTrain,naFeatTest,lSelectedFeatures,classLabelIndex)\n\t\t\tif len(lCorrCoef)==0 or maxCorrCoef < retValue['worstFeatureCorrCoef']:\n\t\t\t\tnewState = set(lSelectedFeatures)\n\t\t\t\tnewState.remove(retValue['worstFeature'])\n\t\t\t\tif newState in lSeenStates:\n\t\t\t\t\tsys.stdout.write('feature not removed b/c state already seen. \\n\\n')\n\t\t\t\t\tbreak\n\t\t\t\tlSelectedFeatures.remove(retValue['worstFeature'])\n\t\t\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\t\t\tlRemainingFeatures.append(retValue['worstFeature'])\n\t\t\t\tlCorrCoef.append(retValue['worstFeatureCorrCoef'])\n\t\t\t\tmaxCorrCoef = max(maxCorrCoef,retValue['worstFeatureCorrCoef'])\n\t\t\telse:\n\t\t\t\tsys.stdout.write('feature not removed b/c corr not higher. \\n\\n')\n\t\t\t\tbreak\n\t\twhile True:\n\t\t\tsys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\\n')\n\t\t\tsys.stdout.write('lRemainingFeatures: ' + str(lRemainingFeatures) + '\\n')\n\t\t\tsys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\\n')\n\t\t\tretValue2 = nextBestFeature(naFeatTrain,naFeatTest,lSelectedFeatures,lRemainingFeatures,classLabelIndex)\n\t\t\tif maxCorrCoef < retValue2['bestFeatureCorrCoef']:\n\t\t\t\tnewState = set(lSelectedFeatures)\n\t\t\t\tnewState.add(retValue2['bestFeature'])\n\t\t\t\tif newState in lSeenStates:\n\t\t\t\t\tsys.stdout.write('feature not added b/c state already seen. \\n\\n')\n\t\t\t\t\tbreak\n\t\t\t\tlSelectedFeatures.append(retValue2['bestFeature'])\n\t\t\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\t\t\tlRemainingFeatures.remove(retValue2['bestFeature'])\n\t\t\t\tlCorrCoef.append(retValue2['bestFeatureCorrCoef'])\n\t\t\t\tmaxCorrCoef = max(maxCorrCoef,retValue2['bestFeatureCorrCoef'])\n\t\t\t\tchange = True\n\t\t\telse:\n\t\t\t\tsys.stdout.write('feature not added b/c corr not higher. \\n\\n')\n\t\t\t\tbreak\n\t\tif not change:\n\t\t\tlSelectedFeatures.remove(retValue['worstFeature'])\n\t\t\tlSeenStates.append(set(lSelectedFeatures))\n\t\t\tlRemainingFeatures.append(retValue['worstFeature'])\n\t\t\tlCorrCoef.append(retValue['worstFeatureCorrCoef'])\n\t\t\tmaxCorrCoef = max(maxCorrCoef,retValue['worstFeatureCorrCoef'])\n\t\t\tsys.stdout.write('feature removed b/c no features were added. \\n\\n')\n\t\n\t\tif len(lSeenStates) >= MAX_ITERATIONS:\n\t\t\tsys.stdout.write('QUITTING B/C len(lSeenStates) >= MAX_ITERATIONS: ' + str(len(lSeenStates)) + '\\n\\n')\n\t\t\tbreak\n\t\n\tmaxlCorrCoef = max(lCorrCoef)\n\tmaxlCorrCoefIndex = lCorrCoef.index(maxlCorrCoef)\n\tsys.stdout.write('best feature set is ' + str(list(lSeenStates[maxlCorrCoefIndex])+[classLabelIndex]) + '\\n')\n\tsys.stdout.write('corr coef = ' + str(maxlCorrCoef))\n\treturn maxlCorrCoef", "metadata": "root.sequentialFloatingBackwardSelectionNew_Max", "header": "['module', '___EOS___']", "index": 400 } ]
[ { "span": "import datetime as dt", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 21 }, { "span": "import pandas as pand", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 21 }, { "span": "import matplotlib.pyplot as plt", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 31 }, { "span": "from QSTK.qstkutil import DataAccess as da", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 42 }, { "span": "from QSTK.qstkutil import qsdateutil as du", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 42 }, { "span": "from QSTK.qstkfeat.features import featMA, featRSI, featDrawDown, featRunUp, featVolumeDelta, featAroon", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 103 }, { "span": "from QSTK.qstkfeat.classes import class_fut_ret", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 47 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "'''", " ", "Pyth", "on", " ", "import", "s", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "as_", "dt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'''", " ", "3", "rd", " ", "part", "y", " ", "import", "s", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pandas_", "as_", "pand", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "'''", " ", "QS", "TK", " ", "import", "s", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "QS", "TK", "_", "._", "qst", "ku", "til_", "import_", "Data", "Access_", "as_", "da_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "QS", "TK", "_", "._", "qst", "ku", "til_", "import_", "qs", "dateutil_", "as_", "du_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "QS", "TK", "_", "._", "qst", "kf", "eat", "_", "._", "features_", "import_", "feat", "MA_", ",_", "feat", "RSI", "_", ",_", "feat", "Draw", "Down_", ",_", "feat", "Run", "Up_", ",_", "feat", "Volume", "Delta_", ",_", "feat", "Aro", "on_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "QS", "TK", "_", "._", "qst", "kf", "eat", "_", "._", "classes_", "import_", "class", "\\u", "fut", "\\u", "ret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "QS", "TK", "_", "._", "qst", "kf", "eat", "_", "._", "feat", "util_", "as_", "ft", "u_", "\\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_", "MAX", "\\u", "ITERA", "TIONS", "_", "=_", "500_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "learner", "Test_", "(_", "na", "Train_", ",_", "na", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "create", " ", "the", " ", "learner", " ", "with", " ", "the", " ", "train", " ", "set", " ", "with", " ", "K", "=", "5_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "c", "Learn", "_", "=_", "ft", "u_", "._", "create", "Kn", "n", "Learner", "_", "(_", "na", "Train_", ",_", "l", "Kn", "n_", "=_", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "get", " ", "the", " ", "Y", " ", "values", " ", "predi", "cte", "d", " ", "by", " ", "the", " ", "learner_", "\\u\\u\\uNL\\u\\u\\u_", "Yp", "red", "ict", "ed_", "=_", "c", "Learn", "_", "._", "query_", "(_", "na", "Test_", "[_", ":_", ",_", ":_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "get", " ", "the", " ", "actual", " ", "Y", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "Y_", "=_", "na", "Test_", "[_", ":_", ",_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "calcul", "ate", " ", "the", " ", "correlation", " ", "coefficient_", "\\u\\u\\uNL\\u\\u\\u_", "corr", "coef_", "=_", "np_", "._", "corr", "coef_", "(_", "Y_", ",_", "Yp", "red", "ict", "ed_", ")_", "[_", "0_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "return", " ", "the", " ", "corr", "coef_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "corr", "coef_", "\\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_", "next", "Bes", "t", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "l", "Rema", "inin", "g", "Features_", ",_", "class", "Label", "Index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "next", "Bes", "t", "Feature", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "best", "Feature_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "Feature", "Corr", "Coe", "f_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "l", "Rema", "inin", "g", "Features_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "l", "Curr", "ent", "Feature", "Set_", "=_", "[_", "x_", "]_", "+_", "l", "Select", "ed", "Features_", "+_", "[_", "class", "Label", "Index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "testi", "ng", " ", "feature", " ", "set", " ", "'_", "+_", "str_", "(_", "l", "Curr", "ent", "Feature", "Set_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "Train_", "=_", "na", "Feat", "Train_", "[_", ":_", ",_", "l", "Curr", "ent", "Feature", "Set_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "Test_", "=_", "na", "Feat", "Test_", "[_", ":_", ",_", "l", "Curr", "ent", "Feature", "Set_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "Corr", "Coe", "f_", "=_", "learner", "Test_", "(_", "current", "Train_", ",_", "current", "Test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", " ", "::", " ", "corr", " ", "coef", " ", "=", " ", "'_", "+_", "str_", "(_", "current", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "best", "Feature_", "==_", "-_", "1_", "or_", "best", "Feature", "Corr", "Coe", "f_", "<_", "current", "Corr", "Coe", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "best", "Feature_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "best", "Feature", "Corr", "Coe", "f_", "=_", "current", "Corr", "Coe", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "next", "Bes", "t", "Feature", ":", " ", "'_", "+_", "str_", "(_", "best", "Feature_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "best", "Feature", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "best", "Feature", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "'", "best", "Feature", "'_", ":_", "best", "Feature_", ",_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", ":_", "best", "Feature", "Corr", "Coe", "f_", "}_", "\\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_", "next", "Wor", "st", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "class", "Label", "Index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "next", "Wor", "st", "Feature", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "l", "Select", "ed", "Features_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "next", "Wor", "st", "Feature", ":", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", "[_", "0_", "]_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "worst", "Feature", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "-_", "999_", ")_", "+_", "'\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "'", "worst", "Feature", "'_", ":_", "l", "Select", "ed", "Features_", "[_", "0_", "]_", ",_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", ":_", "-_", "999_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "worst", "Feature_", "=_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worst", "Feature", "Corr", "Coe", "f_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "l", "Select", "ed", "Features_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "l", "Select", "ed", "Feature", "s", "Copy_", "=_", "l", "Select", "ed", "Features_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Select", "ed", "Feature", "s", "Copy_", "._", "remove_", "(_", "x_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Curr", "ent", "Feature", "Set_", "=_", "l", "Select", "ed", "Feature", "s", "Copy_", "+_", "[_", "class", "Label", "Index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "testi", "ng", " ", "feature", " ", "set", " ", "'_", "+_", "str_", "(_", "l", "Curr", "ent", "Feature", "Set_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "Train_", "=_", "na", "Feat", "Train_", "[_", ":_", ",_", "l", "Curr", "ent", "Feature", "Set_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "Test_", "=_", "na", "Feat", "Test_", "[_", ":_", ",_", "l", "Curr", "ent", "Feature", "Set_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "Corr", "Coe", "f_", "=_", "learner", "Test_", "(_", "current", "Train_", ",_", "current", "Test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", " ", "::", " ", "corr", " ", "coef", " ", "=", " ", "'_", "+_", "str_", "(_", "current", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "worst", "Feature_", "==_", "-_", "1_", "or_", "worst", "Feature", "Corr", "Coe", "f_", "<_", "current", "Corr", "Coe", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "worst", "Feature_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "worst", "Feature", "Corr", "Coe", "f_", "=_", "current", "Corr", "Coe", "f_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "next", "Wor", "st", "Feature", ":", " ", "'_", "+_", "str_", "(_", "worst", "Feature_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "worst", "Feature", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "worst", "Feature", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "'", "worst", "Feature", "'_", ":_", "worst", "Feature_", ",_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", ":_", "worst", "Feature", "Corr", "Coe", "f_", "}_", "\\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_", "sequential", "Forward", "Selection_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Features_", ",_", "class", "Label", "Index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "l", "Select", "ed", "Features_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "=_", "l", "Features_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "=_", "list_", "(_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "len_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Select", "ed", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Rema", "inin", "g", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "l", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "Value_", "=_", "next", "Bes", "t", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "l", "Rema", "inin", "g", "Features_", ",_", "class", "Label", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Select", "ed", "Features_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "remove_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "maxl", "Corr", "Coe", "f_", "=_", "max_", "(_", "l", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxl", "Corr", "Coe", "f", "Index_", "=_", "l", "Corr", "Coe", "f_", "._", "index_", "(_", "maxl", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "best", " ", "feature", " ", "set", " ", "is", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", "[_", "0_", ":_", "maxl", "Corr", "Coe", "f", "Index_", "+_", "1_", "]_", "+_", "[_", "class", "Label", "Index_", "]_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "corr", " ", "coef", " ", "=", " ", "'_", "+_", "str_", "(_", "maxl", "Corr", "Coe", "f_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "maxl", "Corr", "Coe", "f_", "\\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_", "sequential", "Backward", "Selection_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Features_", ",_", "class", "Label", "Index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "l", "Select", "ed", "Features_", "=_", "l", "Features_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Remove", "d", "Features_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "len_", "(_", "l", "Select", "ed", "Features_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Select", "ed", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Remove", "d", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Remove", "d", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "l", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "Value_", "=_", "next", "Wor", "st", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "class", "Label", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Select", "ed", "Features_", "._", "remove_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Remove", "d", "Features_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "maxl", "Corr", "Coe", "f_", "=_", "max_", "(_", "l", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxl", "Corr", "Coe", "f", "Index_", "=_", "l", "Corr", "Coe", "f_", "._", "index_", "(_", "maxl", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Bes", "t", "Set_", "=_", "list_", "(_", "set_", "(_", "l", "Features_", ")_", "-_", "set_", "(_", "l", "Remove", "d", "Features_", "[_", "0_", ":_", "maxl", "Corr", "Coe", "f", "Index_", "+_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "best", " ", "feature", " ", "set", " ", "is", " ", "'_", "+_", "str_", "(_", "l", "Bes", "t", "Set_", "+_", "[_", "class", "Label", "Index_", "]_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "corr", " ", "coef", " ", "=", " ", "'_", "+_", "str_", "(_", "maxl", "Corr", "Coe", "f_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "maxl", "Corr", "Coe", "f_", "\\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_", "sequential", "Float", "ing", "Forward", "Selection_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Features_", ",_", "class", "Label", "Index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "global_", "MAX", "\\u", "ITERA", "TIONS", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Select", "ed", "Features_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "=_", "l", "Features_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "len_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Select", "ed", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Rema", "inin", "g", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "l", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "Value_", "=_", "next", "Bes", "t", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "l", "Rema", "inin", "g", "Features_", ",_", "class", "Label", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Select", "ed", "Features_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "remove_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Select", "ed", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Rema", "inin", "g", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "l", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "Value", "2_", "=_", "next", "Wor", "st", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "class", "Label", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "l", "Corr", "Coe", "f_", "[_", "-_", "1_", "]_", "<_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "new", "State_", "=_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "State_", "._", "remove_", "(_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "new", "State_", "in_", "l", "Seen", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "remove", "d", " ", "b", "/", "c", " ", "state", " ", "alr", "ead", "y", " ", "see", "n", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "l", "Select", "ed", "Features_", "._", "remove_", "(_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "append_", "(_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "remove", "d", " ", "b", "/", "c", " ", "corr", " ", "not", " ", "higher", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "if_", "len_", "(_", "l", "Seen", "States_", ")_", ">=_", "MAX", "\\u", "ITERA", "TIONS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "QUI", "TT", "ING", " ", "B", "/", "C", " ", "len", "(", "l", "Seen", "State", "s", ")", " ", ">=", " ", "MAX", "\\u", "ITERA", "TIONS", ":", " ", "'_", "+_", "str_", "(_", "len_", "(_", "l", "Seen", "States_", ")_", ")_", "+_", "'\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "maxl", "Corr", "Coe", "f_", "=_", "max_", "(_", "l", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxl", "Corr", "Coe", "f", "Index_", "=_", "l", "Corr", "Coe", "f_", "._", "index_", "(_", "maxl", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "best", " ", "feature", " ", "set", " ", "is", " ", "'_", "+_", "str_", "(_", "list_", "(_", "l", "Seen", "States_", "[_", "maxl", "Corr", "Coe", "f", "Index_", "]_", ")_", "+_", "[_", "class", "Label", "Index_", "]_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "corr", " ", "coef", " ", "=", " ", "'_", "+_", "str_", "(_", "maxl", "Corr", "Coe", "f_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "maxl", "Corr", "Coe", "f_", "\\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_", "sequential", "Float", "ing", "Backward", "Selection_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Features_", ",_", "class", "Label", "Index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "global_", "MAX", "\\u", "ITERA", "TIONS", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Select", "ed", "Features_", "=_", "l", "Features_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "len_", "(_", "l", "Select", "ed", "Features_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Select", "ed", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Rema", "inin", "g", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "l", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "Value_", "=_", "next", "Wor", "st", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "class", "Label", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Select", "ed", "Features_", "._", "remove_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Select", "ed", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Rema", "inin", "g", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "l", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "Value", "2_", "=_", "next", "Bes", "t", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "l", "Rema", "inin", "g", "Features_", ",_", "class", "Label", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "l", "Corr", "Coe", "f_", "[_", "-_", "1_", "]_", "<_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "new", "State_", "=_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "State_", "._", "add_", "(_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "new", "State_", "in_", "l", "Seen", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "adde", "d", " ", "b", "/", "c", " ", "state", " ", "alr", "ead", "y", " ", "see", "n", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "l", "Select", "ed", "Features_", "._", "append_", "(_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "remove_", "(_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "adde", "d", " ", "b", "/", "c", " ", "corr", " ", "not", " ", "higher", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "if_", "len_", "(_", "l", "Seen", "States_", ")_", ">=_", "MAX", "\\u", "ITERA", "TIONS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "QUI", "TT", "ING", " ", "B", "/", "C", " ", "len", "(", "l", "Seen", "State", "s", ")", " ", ">=", " ", "MAX", "\\u", "ITERA", "TIONS", ":", " ", "'_", "+_", "str_", "(_", "len_", "(_", "l", "Seen", "States_", ")_", ")_", "+_", "'\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "maxl", "Corr", "Coe", "f_", "=_", "max_", "(_", "l", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxl", "Corr", "Coe", "f", "Index_", "=_", "l", "Corr", "Coe", "f_", "._", "index_", "(_", "maxl", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "best", " ", "feature", " ", "set", " ", "is", " ", "'_", "+_", "str_", "(_", "list_", "(_", "l", "Seen", "States_", "[_", "maxl", "Corr", "Coe", "f", "Index_", "]_", ")_", "+_", "[_", "class", "Label", "Index_", "]_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "corr", " ", "coef", " ", "=", " ", "'_", "+_", "str_", "(_", "maxl", "Corr", "Coe", "f_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "maxl", "Corr", "Coe", "f_", "\\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_", "sequential", "Float", "ing", "Forward", "Selecti", "on", "New_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Features_", ",_", "class", "Label", "Index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "global_", "MAX", "\\u", "ITERA", "TIONS", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Select", "ed", "Features_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "=_", "l", "Features_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ret", "Value_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "len_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "change_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Select", "ed", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Rema", "inin", "g", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "l", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "Value_", "=_", "next", "Bes", "t", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "l", "Rema", "inin", "g", "Features_", ",_", "class", "Label", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "l", "Corr", "Coe", "f_", ")_", "==_", "0_", "or_", "l", "Corr", "Coe", "f_", "[_", "-_", "1_", "]_", "<_", "ret", "Value_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "new", "State_", "=_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "State_", "._", "add_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "new", "State_", "in_", "l", "Seen", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "adde", "d", " ", "b", "/", "c", " ", "state", " ", "alr", "ead", "y", " ", "see", "n", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "l", "Select", "ed", "Features_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "remove_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "adde", "d", " ", "b", "/", "c", " ", "corr", " ", "not", " ", "higher", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Select", "ed", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Rema", "inin", "g", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "l", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "Value", "2_", "=_", "next", "Wor", "st", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "class", "Label", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "l", "Corr", "Coe", "f_", "[_", "-_", "1_", "]_", "<_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "new", "State_", "=_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "State_", "._", "remove_", "(_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "new", "State_", "in_", "l", "Seen", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "remove", "d", " ", "b", "/", "c", " ", "state", " ", "alr", "ead", "y", " ", "see", "n", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "l", "Select", "ed", "Features_", "._", "remove_", "(_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "append_", "(_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "change_", "=_", "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\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "remove", "d", " ", "b", "/", "c", " ", "corr", " ", "not", " ", "higher", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "if_", "not_", "change_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "l", "Select", "ed", "Features_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "remove_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "adde", "d", " ", "b", "/", "c", " ", "no", " ", "features", " ", "wer", "e", " ", "remove", "d", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "l", "Seen", "States_", ")_", ">=_", "MAX", "\\u", "ITERA", "TIONS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "QUI", "TT", "ING", " ", "B", "/", "C", " ", "len", "(", "l", "Seen", "State", "s", ")", " ", ">=", " ", "MAX", "\\u", "ITERA", "TIONS", ":", " ", "'_", "+_", "str_", "(_", "len_", "(_", "l", "Seen", "States_", ")_", ")_", "+_", "'\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "maxl", "Corr", "Coe", "f_", "=_", "max_", "(_", "l", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxl", "Corr", "Coe", "f", "Index_", "=_", "l", "Corr", "Coe", "f_", "._", "index_", "(_", "maxl", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "best", " ", "feature", " ", "set", " ", "is", " ", "'_", "+_", "str_", "(_", "list_", "(_", "l", "Seen", "States_", "[_", "maxl", "Corr", "Coe", "f", "Index_", "]_", ")_", "+_", "[_", "class", "Label", "Index_", "]_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "corr", " ", "coef", " ", "=", " ", "'_", "+_", "str_", "(_", "maxl", "Corr", "Coe", "f_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "maxl", "Corr", "Coe", "f_", "\\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_", "sequential", "Float", "ing", "Backward", "Selecti", "on", "New_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Features_", ",_", "class", "Label", "Index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "global_", "MAX", "\\u", "ITERA", "TIONS", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Select", "ed", "Features_", "=_", "l", "Features_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ret", "Value_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "len_", "(_", "l", "Select", "ed", "Features_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "change_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Select", "ed", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Rema", "inin", "g", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "l", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "Value_", "=_", "next", "Wor", "st", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "class", "Label", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "l", "Corr", "Coe", "f_", ")_", "==_", "0_", "or_", "l", "Corr", "Coe", "f_", "[_", "-_", "1_", "]_", "<_", "ret", "Value_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "new", "State_", "=_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "State_", "._", "remove_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "new", "State_", "in_", "l", "Seen", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "remove", "d", " ", "b", "/", "c", " ", "state", " ", "alr", "ead", "y", " ", "see", "n", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "l", "Select", "ed", "Features_", "._", "remove_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "remove", "d", " ", "b", "/", "c", " ", "corr", " ", "not", " ", "higher", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Select", "ed", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Rema", "inin", "g", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "l", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "Value", "2_", "=_", "next", "Bes", "t", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "l", "Rema", "inin", "g", "Features_", ",_", "class", "Label", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "l", "Corr", "Coe", "f_", "[_", "-_", "1_", "]_", "<_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "new", "State_", "=_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "State_", "._", "add_", "(_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "new", "State_", "in_", "l", "Seen", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "adde", "d", " ", "b", "/", "c", " ", "state", " ", "alr", "ead", "y", " ", "see", "n", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "l", "Select", "ed", "Features_", "._", "append_", "(_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "remove_", "(_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "change_", "=_", "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\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "adde", "d", " ", "b", "/", "c", " ", "corr", " ", "not", " ", "higher", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "if_", "not_", "change_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "l", "Select", "ed", "Features_", "._", "remove_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "remove", "d", " ", "b", "/", "c", " ", "no", " ", "features", " ", "wer", "e", " ", "adde", "d", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "l", "Seen", "States_", ")_", ">=_", "MAX", "\\u", "ITERA", "TIONS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "QUI", "TT", "ING", " ", "B", "/", "C", " ", "len", "(", "l", "Seen", "State", "s", ")", " ", ">=", " ", "MAX", "\\u", "ITERA", "TIONS", ":", " ", "'_", "+_", "str_", "(_", "len_", "(_", "l", "Seen", "States_", ")_", ")_", "+_", "'\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "maxl", "Corr", "Coe", "f_", "=_", "max_", "(_", "l", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxl", "Corr", "Coe", "f", "Index_", "=_", "l", "Corr", "Coe", "f_", "._", "index_", "(_", "maxl", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "best", " ", "feature", " ", "set", " ", "is", " ", "'_", "+_", "str_", "(_", "list_", "(_", "l", "Seen", "States_", "[_", "maxl", "Corr", "Coe", "f", "Index_", "]_", ")_", "+_", "[_", "class", "Label", "Index_", "]_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "corr", " ", "coef", " ", "=", " ", "'_", "+_", "str_", "(_", "maxl", "Corr", "Coe", "f_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "maxl", "Corr", "Coe", "f_", "\\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_", "sequential", "Float", "ing", "Forward", "Selecti", "on", "New", "\\u", "Max_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Features_", ",_", "class", "Label", "Index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "global_", "MAX", "\\u", "ITERA", "TIONS", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Select", "ed", "Features_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "=_", "l", "Features_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "Corr", "Coe", "f_", "=_", "-_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ret", "Value_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "len_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "change_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Select", "ed", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Rema", "inin", "g", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "l", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "Value_", "=_", "next", "Bes", "t", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "l", "Rema", "inin", "g", "Features_", ",_", "class", "Label", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "l", "Corr", "Coe", "f_", ")_", "==_", "0_", "or_", "max", "Corr", "Coe", "f_", "<_", "ret", "Value_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "new", "State_", "=_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "State_", "._", "add_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "new", "State_", "in_", "l", "Seen", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "adde", "d", " ", "b", "/", "c", " ", "state", " ", "alr", "ead", "y", " ", "see", "n", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "l", "Select", "ed", "Features_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "remove_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "Corr", "Coe", "f_", "=_", "max_", "(_", "max", "Corr", "Coe", "f_", ",_", "ret", "Value_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "adde", "d", " ", "b", "/", "c", " ", "corr", " ", "not", " ", "higher", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Select", "ed", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Rema", "inin", "g", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "l", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "Value", "2_", "=_", "next", "Wor", "st", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "class", "Label", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "max", "Corr", "Coe", "f_", "<_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "new", "State_", "=_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "State_", "._", "remove_", "(_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "new", "State_", "in_", "l", "Seen", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "remove", "d", " ", "b", "/", "c", " ", "state", " ", "alr", "ead", "y", " ", "see", "n", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "l", "Select", "ed", "Features_", "._", "remove_", "(_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "append_", "(_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "Corr", "Coe", "f_", "=_", "max_", "(_", "max", "Corr", "Coe", "f_", ",_", "ret", "Value", "2_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "change_", "=_", "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\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "remove", "d", " ", "b", "/", "c", " ", "corr", " ", "not", " ", "higher", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "if_", "not_", "change_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "l", "Select", "ed", "Features_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "remove_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "Corr", "Coe", "f_", "=_", "max_", "(_", "max", "Corr", "Coe", "f_", ",_", "ret", "Value_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "adde", "d", " ", "b", "/", "c", " ", "no", " ", "features", " ", "wer", "e", " ", "remove", "d", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "l", "Seen", "States_", ")_", ">=_", "MAX", "\\u", "ITERA", "TIONS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "QUI", "TT", "ING", " ", "B", "/", "C", " ", "len", "(", "l", "Seen", "State", "s", ")", " ", ">=", " ", "MAX", "\\u", "ITERA", "TIONS", ":", " ", "'_", "+_", "str_", "(_", "len_", "(_", "l", "Seen", "States_", ")_", ")_", "+_", "'\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "maxl", "Corr", "Coe", "f_", "=_", "max_", "(_", "l", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxl", "Corr", "Coe", "f", "Index_", "=_", "l", "Corr", "Coe", "f_", "._", "index_", "(_", "maxl", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "best", " ", "feature", " ", "set", " ", "is", " ", "'_", "+_", "str_", "(_", "list_", "(_", "l", "Seen", "States_", "[_", "maxl", "Corr", "Coe", "f", "Index_", "]_", ")_", "+_", "[_", "class", "Label", "Index_", "]_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "corr", " ", "coef", " ", "=", " ", "'_", "+_", "str_", "(_", "maxl", "Corr", "Coe", "f_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "maxl", "Corr", "Coe", "f_", "\\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_", "sequential", "Float", "ing", "Backward", "Selecti", "on", "New", "\\u", "Max_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Features_", ",_", "class", "Label", "Index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "global_", "MAX", "\\u", "ITERA", "TIONS", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Select", "ed", "Features_", "=_", "l", "Features_", "[_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "Corr", "Coe", "f_", "=_", "-_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ret", "Value_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "len_", "(_", "l", "Select", "ed", "Features_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "change_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Select", "ed", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Rema", "inin", "g", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "l", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "Value_", "=_", "next", "Wor", "st", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "class", "Label", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "l", "Corr", "Coe", "f_", ")_", "==_", "0_", "or_", "max", "Corr", "Coe", "f_", "<_", "ret", "Value_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "new", "State_", "=_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "State_", "._", "remove_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "new", "State_", "in_", "l", "Seen", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "remove", "d", " ", "b", "/", "c", " ", "state", " ", "alr", "ead", "y", " ", "see", "n", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "l", "Select", "ed", "Features_", "._", "remove_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "Corr", "Coe", "f_", "=_", "max_", "(_", "max", "Corr", "Coe", "f_", ",_", "ret", "Value_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "remove", "d", " ", "b", "/", "c", " ", "corr", " ", "not", " ", "higher", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Select", "ed", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Select", "ed", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Rema", "inin", "g", "Feature", "s", ":", " ", "'_", "+_", "str_", "(_", "l", "Rema", "inin", "g", "Features_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "l", "Corr", "Coe", "f", ":", " ", "'_", "+_", "str_", "(_", "l", "Corr", "Coe", "f_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "Value", "2_", "=_", "next", "Bes", "t", "Feature_", "(_", "na", "Feat", "Train_", ",_", "na", "Feat", "Test_", ",_", "l", "Select", "ed", "Features_", ",_", "l", "Rema", "inin", "g", "Features_", ",_", "class", "Label", "Index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "max", "Corr", "Coe", "f_", "<_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "new", "State_", "=_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "State_", "._", "add_", "(_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "new", "State_", "in_", "l", "Seen", "States_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "adde", "d", " ", "b", "/", "c", " ", "state", " ", "alr", "ead", "y", " ", "see", "n", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "l", "Select", "ed", "Features_", "._", "append_", "(_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "remove_", "(_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "Corr", "Coe", "f_", "=_", "max_", "(_", "max", "Corr", "Coe", "f_", ",_", "ret", "Value", "2_", "[_", "'", "best", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "change_", "=_", "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\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "not", " ", "adde", "d", " ", "b", "/", "c", " ", "corr", " ", "not", " ", "higher", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "if_", "not_", "change_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "l", "Select", "ed", "Features_", "._", "remove_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Seen", "States_", "._", "append_", "(_", "set_", "(_", "l", "Select", "ed", "Features_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Rema", "inin", "g", "Features_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l", "Corr", "Coe", "f_", "._", "append_", "(_", "ret", "Value_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "Corr", "Coe", "f_", "=_", "max_", "(_", "max", "Corr", "Coe", "f_", ",_", "ret", "Value_", "[_", "'", "worst", "Feature", "Corr", "Coe", "f", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "feature", " ", "remove", "d", " ", "b", "/", "c", " ", "no", " ", "features", " ", "wer", "e", " ", "adde", "d", ".", " ", "\\\\", "n", "\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "l", "Seen", "States_", ")_", ">=_", "MAX", "\\u", "ITERA", "TIONS", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "QUI", "TT", "ING", " ", "B", "/", "C", " ", "len", "(", "l", "Seen", "State", "s", ")", " ", ">=", " ", "MAX", "\\u", "ITERA", "TIONS", ":", " ", "'_", "+_", "str_", "(_", "len_", "(_", "l", "Seen", "States_", ")_", ")_", "+_", "'\\\\", "n", "\\\\", "n", "'_", ")_", "\\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_", "maxl", "Corr", "Coe", "f_", "=_", "max_", "(_", "l", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "maxl", "Corr", "Coe", "f", "Index_", "=_", "l", "Corr", "Coe", "f_", "._", "index_", "(_", "maxl", "Corr", "Coe", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "best", " ", "feature", " ", "set", " ", "is", " ", "'_", "+_", "str_", "(_", "list_", "(_", "l", "Seen", "States_", "[_", "maxl", "Corr", "Coe", "f", "Index_", "]_", ")_", "+_", "[_", "class", "Label", "Index_", "]_", ")_", "+_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'", "corr", " ", "coef", " ", "=", " ", "'_", "+_", "str_", "(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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 ]
Unused import
neurodata/ndstore/ocpca/jsonprojinfo.py
[ { "content": "#/p Copyright 2014 Open Connectome Project (http://openconnecto.me)\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\nimport numpy as np\nimport json\nimport urllib2\nfrom lxml import etree\nfrom django.conf import settings\n\nimport ocpcadb\nfrom ocptype import ZSLICES\n\nimport logging\nlogger=logging.getLogger(\"ocp\")\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def projdict ( proj ):\n\n projdict = {}\n projdict['name'] = proj.getProjectName()\n projdict['description'] = proj.getProjectDescription()\n projdict['version'] = proj.getOCPVersion()\n\n # These fields are internal\n #projdict['dbname'] = proj._dbname\n #projdict['host'] = proj._dbhost\n #projdict['schemaversion'] = proj.getSchemaVersion()\n #projdict['kvengine'] = proj._kvengine\n #projdict['kvserver'] = proj._kvserver\n\n return projdict", "metadata": "root.projdict", "header": "['module', '___EOS___']", "index": 28 }, { "content": "def datasetdict ( dataset ):\n\n dsdict = {}\n dsdict['name'] = dataset.getDatasetName()\n dsdict['scalinglevels'] = dataset.scalinglevels\n if dataset.scalingoption == ZSLICES:\n dsdict['scaling'] = 'zslices'\n else:\n dsdict['scaling'] = 'xyz'\n dsdict['resolutions'] = dataset.resolutions\n dsdict['imagesize'] = dataset.imagesz\n dsdict['offset'] = dataset.offset\n dsdict['voxelres'] = dataset.voxelres\n dsdict['cube_dimension'] = dataset.cubedim\n # Stephan projinfo\n dsdict['neariso_scaledown'] = dataset.nearisoscaledown\n dsdict['neariso_offset'] = dataset.neariso_offset\n dsdict['neariso_voxelres'] = dataset.neariso_voxelres\n dsdict['neariso_imagesize'] = dataset.neariso_imagesz\n # Figure out neariso in new design\n dsdict['timerange'] = dataset.timerange\n dsdict['description'] = dataset.getDatasetDescription()\n\n return dsdict", "metadata": "root.datasetdict", "header": "['module', '___EOS___']", "index": 44 }, { "content": "def chandict ( channel ):\n chandict = {}\n chandict['channel_type'] = channel.getChannelType()\n chandict['datatype'] = channel.getDataType()\n chandict['exceptions'] = channel.getExceptions()\n chandict['readonly'] = channel.getReadOnly()\n chandict['resolution'] = channel.getResolution()\n chandict['propagate'] = channel.getPropagate()\n chandict['windowrange'] = channel.getWindowRange()\n chandict['description'] = channel.getChannelDescription()\n\n return chandict", "metadata": "root.chandict", "header": "['module', '___EOS___']", "index": 69 }, { "content": "def jsonInfo (proj):\n \"\"\"All Project Info\"\"\"\n\n jsonprojinfo = {}\n jsonprojinfo['dataset'] = datasetdict ( proj.datasetcfg )\n jsonprojinfo['project'] = projdict ( proj )\n jsonprojinfo['channels'] = {}\n for ch in proj.projectChannels():\n jsonprojinfo['channels'][ch.getChannelName()] = chandict ( ch ) \n \n jsonprojinfo['metadata'] = metadatadict( proj )\n return json.dumps ( jsonprojinfo, sort_keys=True, indent=4 )", "metadata": "root.jsonInfo", "header": "['module', '___EOS___']", "index": 82 }, { "content": "def xmlInfo (token, proj):\n \"\"\"All Project Info\"\"\"\n \n jsonprojinfo = {}\n jsonprojinfo['dataset'] = datasetdict ( proj.datasetcfg )\n jsonprojinfo['project'] = projdict ( proj )\n jsonprojinfo['channels'] = {}\n for ch in proj.projectChannels():\n jsonprojinfo['channels'][ch.getChannelName()] = chandict ( ch ) \n jsonprojinfo['metadata'] = metadatadict( proj )\n \n root = etree.Element('Volume', InputChecksum=\"\", host=\"http://openconnecto.me/ocptilecache/tilecache/viking/\", name=token, num_sections=str(jsonprojinfo['dataset']['imagesize'][0][2]), num_stos=\"0\", path=\"http://openconnecto.me/ocptilecache/tilecache/viking/\")\n etree.SubElement(root, 'Scale', UnitsOfMeasure=\"nm\", UnitsPerPixel=str(jsonprojinfo['dataset']['voxelres'][0][0]/jsonprojinfo['dataset']['voxelres'][0][1]))\n tileserver_element = etree.SubElement(root, 'OCPTileServer', CoordSpaceName=\"volume\", host=\"http://openconnecto.me/ocptilecache/tilecache/viking/\", FilePrefix=\"\", FilePostfix=\".png\", TileXDim=\"512\", TileYDim=\"512\", GridXdim=str(jsonprojinfo['dataset']['imagesize'][0][0]/512), GridYDim=str(jsonprojinfo['dataset']['imagesize'][0][1]/512), MaxLevel=str(jsonprojinfo['dataset'][\"resolutions\"][-1]))\n for channel_name in jsonprojinfo['channels'].keys():\n etree.SubElement(tileserver_element, \"Channel\", Name=channel_name, Path=channel_name, Datatype=jsonprojinfo['channels'][channel_name]['datatype'])\n for slice_number in range(jsonprojinfo['dataset']['offset'][0][2], jsonprojinfo['dataset']['offset'][0][2]+jsonprojinfo['dataset']['imagesize'][0][2]):\n etree.SubElement(root, \"Section\", Number=\"{}\".format(slice_number))\n \n return etree.tostring(root)", "metadata": "root.xmlInfo", "header": "['module', '___EOS___']", "index": 95 }, { "content": "def metadatadict( proj ):\n \"\"\"Metadata Info\"\"\"\n if settings.LIMS_SERVER_ENABLED:\n try:\n url = 'http://{}/metadata/ocp/get/{}/'.format(settings.LIMS_SERVER, proj.getProjectName())\n req = urllib2.Request(url)\n response = urllib2.urlopen(req, timeout=0.5)\n return json.loads(response.read())\n except urllib2.URLError, e:\n print \"Failed URL {}\".format(url)\n return {}\n else:\n return {}", "metadata": "root.metadatadict", "header": "['module', '___EOS___']", "index": 116 }, { "content": "def publicTokens ( projdb ):\n \"\"\"List of Public Tokens\"\"\"\n \n tokens = projdb.getPublic ()\n return json.dumps (tokens, sort_keys=True, indent=4)", "metadata": "root.publicTokens", "header": "['module', '___EOS___']", "index": 130 } ]
[ { "span": "import numpy as np", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 18 }, { "span": "import ocpcadb", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 14 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "/", "p", " ", "Copy", "right", " ", "2014", " ", "Open", " ", "Connect", "ome", " ", "Project", " ", "(", "http", "://", "openco", "nnect", "o", ".", "me", ")_", "\\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_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lxml_", "import_", "etree_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "oc", "pca", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "oc", "ptype_", "import_", "ZS", "LIC", "ES_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "\"", "oc", "p", "\"_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "proj", "dict_", "(_", "proj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proj", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proj", "dict_", "[_", "'", "name", "'_", "]_", "=_", "proj_", "._", "get", "Project", "Name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proj", "dict_", "[_", "'", "description", "'_", "]_", "=_", "proj_", "._", "get", "Project", "Description_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proj", "dict_", "[_", "'", "version", "'_", "]_", "=_", "proj_", "._", "get", "OC", "PV", "ersion_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", "se", " ", "fields", " ", "are", " ", "internal_", "\\u\\u\\uNL\\u\\u\\u_", "#", "proj", "dict", "['", "db", "name", "']", " ", "=", " ", "proj", ".\\u", "dbname_", "\\u\\u\\uNL\\u\\u\\u_", "#", "proj", "dict", "['", "host", "']", " ", "=", " ", "proj", ".\\u", "dbh", "ost_", "\\u\\u\\uNL\\u\\u\\u_", "#", "proj", "dict", "['", "schema", "version", "']", " ", "=", " ", "proj", ".", "get", "Schema", "Version", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "proj", "dict", "['", "kv", "eng", "ine", "']", " ", "=", " ", "proj", ".\\u", "kv", "engine_", "\\u\\u\\uNL\\u\\u\\u_", "#", "proj", "dict", "['", "kvs", "erver", "']", " ", "=", " ", "proj", ".\\u", "kvs", "erver_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "proj", "dict_", "\\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_", "dataset", "dict_", "(_", "dataset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dsd", "ict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dsd", "ict_", "[_", "'", "name", "'_", "]_", "=_", "dataset_", "._", "get", "Datas", "et", "Name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dsd", "ict_", "[_", "'", "scal", "ingl", "evel", "s", "'_", "]_", "=_", "dataset_", "._", "scal", "ingl", "evel", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "dataset_", "._", "scal", "ing", "option_", "==_", "ZS", "LIC", "ES_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dsd", "ict_", "[_", "'", "scal", "ing", "'_", "]_", "=_", "'", "zs", "lice", "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 ", " _", "dsd", "ict_", "[_", "'", "scal", "ing", "'_", "]_", "=_", "'", "xyz", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dsd", "ict_", "[_", "'", "resolu", "tion", "s", "'_", "]_", "=_", "dataset_", "._", "resolu", "tions_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dsd", "ict_", "[_", "'", "images", "ize", "'_", "]_", "=_", "dataset_", "._", "images", "z_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dsd", "ict_", "[_", "'", "offset", "'_", "]_", "=_", "dataset_", "._", "offset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dsd", "ict_", "[_", "'", "voxel", "res", "'_", "]_", "=_", "dataset_", "._", "voxel", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dsd", "ict_", "[_", "'", "cube", "\\u", "dimension", "'_", "]_", "=_", "dataset_", "._", "cube", "dim_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Step", "han", " ", "proj", "info_", "\\u\\u\\uNL\\u\\u\\u_", "dsd", "ict_", "[_", "'", "near", "iso", "\\u", "scale", "down", "'_", "]_", "=_", "dataset_", "._", "near", "iso", "scale", "down_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dsd", "ict_", "[_", "'", "near", "iso", "\\u", "offset", "'_", "]_", "=_", "dataset_", "._", "near", "iso", "\\u", "offset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dsd", "ict_", "[_", "'", "near", "iso", "\\u", "voxel", "res", "'_", "]_", "=_", "dataset_", "._", "near", "iso", "\\u", "voxel", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dsd", "ict_", "[_", "'", "near", "iso", "\\u", "images", "ize", "'_", "]_", "=_", "dataset_", "._", "near", "iso", "\\u", "images", "z_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fig", "ure", " ", "out", " ", "near", "iso", " ", "in", " ", "new", " ", "design_", "\\u\\u\\uNL\\u\\u\\u_", "dsd", "ict_", "[_", "'", "timer", "ange", "'_", "]_", "=_", "dataset_", "._", "timer", "ange_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dsd", "ict_", "[_", "'", "description", "'_", "]_", "=_", "dataset_", "._", "get", "Datas", "et", "Description_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "dsd", "ict_", "\\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_", "chan", "dict_", "(_", "channel_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "chan", "dict_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chan", "dict_", "[_", "'", "channel", "\\u", "type", "'_", "]_", "=_", "channel_", "._", "get", "Chan", "nel", "Type_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chan", "dict_", "[_", "'", "datatype", "'_", "]_", "=_", "channel_", "._", "get", "Data", "Type_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chan", "dict_", "[_", "'", "exception", "s", "'_", "]_", "=_", "channel_", "._", "get", "Exceptions_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chan", "dict_", "[_", "'", "read", "only", "'_", "]_", "=_", "channel_", "._", "get", "Read", "Only_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chan", "dict_", "[_", "'", "resolu", "tion", "'_", "]_", "=_", "channel_", "._", "get", "Resolution_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chan", "dict_", "[_", "'", "propagate", "'_", "]_", "=_", "channel_", "._", "get", "Propag", "ate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chan", "dict_", "[_", "'", "window", "range", "'_", "]_", "=_", "channel_", "._", "get", "Window", "Range_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "chan", "dict_", "[_", "'", "description", "'_", "]_", "=_", "channel_", "._", "get", "Chan", "nel", "Description_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "chan", "dict_", "\\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_", "json", "Info_", "(_", "proj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "All", " ", "Project", " ", "Info", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "jsonp", "roj", "info_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jsonp", "roj", "info_", "[_", "'", "dataset", "'_", "]_", "=_", "dataset", "dict_", "(_", "proj_", "._", "dataset", "cfg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jsonp", "roj", "info_", "[_", "'", "project", "'_", "]_", "=_", "proj", "dict_", "(_", "proj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jsonp", "roj", "info_", "[_", "'", "channel", "s", "'_", "]_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ch_", "in_", "proj_", "._", "project", "Channels_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jsonp", "roj", "info_", "[_", "'", "channel", "s", "'_", "]_", "[_", "ch_", "._", "get", "Chan", "nel", "Name_", "(_", ")_", "]_", "=_", "chan", "dict_", "(_", "ch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "jsonp", "roj", "info_", "[_", "'", "metadata", "'_", "]_", "=_", "metadata", "dict_", "(_", "proj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "json_", "._", "dumps_", "(_", "jsonp", "roj", "info_", ",_", "sort", "\\u", "keys_", "=_", "True_", ",_", "indent_", "=_", "4_", ")_", "\\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_", "xml", "Info_", "(_", "token_", ",_", "proj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "All", " ", "Project", " ", "Info", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "jsonp", "roj", "info_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jsonp", "roj", "info_", "[_", "'", "dataset", "'_", "]_", "=_", "dataset", "dict_", "(_", "proj_", "._", "dataset", "cfg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jsonp", "roj", "info_", "[_", "'", "project", "'_", "]_", "=_", "proj", "dict_", "(_", "proj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jsonp", "roj", "info_", "[_", "'", "channel", "s", "'_", "]_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ch_", "in_", "proj_", "._", "project", "Channels_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "jsonp", "roj", "info_", "[_", "'", "channel", "s", "'_", "]_", "[_", "ch_", "._", "get", "Chan", "nel", "Name_", "(_", ")_", "]_", "=_", "chan", "dict_", "(_", "ch_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "jsonp", "roj", "info_", "[_", "'", "metadata", "'_", "]_", "=_", "metadata", "dict_", "(_", "proj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "=_", "etree_", "._", "Element_", "(_", "'", "Volume", "'_", ",_", "Inp", "ut", "Checksum", "_", "=_", "\"\"_", ",_", "host_", "=_", "\"", "http", "://", "openco", "nnect", "o", ".", "me", "/", "oc", "pti", "lec", "ache", "/", "tile", "cache", "/", "vi", "king", "/\"_", ",_", "name_", "=_", "token_", ",_", "num", "\\u", "sections_", "=_", "str_", "(_", "jsonp", "roj", "info_", "[_", "'", "dataset", "'_", "]_", "[_", "'", "images", "ize", "'_", "]_", "[_", "0_", "]_", "[_", "2_", "]_", ")_", ",_", "num", "\\u", "sto", "s_", "=_", "\"", "0", "\"_", ",_", "path_", "=_", "\"", "http", "://", "openco", "nnect", "o", ".", "me", "/", "oc", "pti", "lec", "ache", "/", "tile", "cache", "/", "vi", "king", "/\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "etree_", "._", "Sub", "Element_", "(_", "root_", ",_", "'", "Scale", "'_", ",_", "Unit", "s", "Of", "Measure_", "=_", "\"", "nm", "\"_", ",_", "Unit", "s", "Per", "Pixel_", "=_", "str_", "(_", "jsonp", "roj", "info_", "[_", "'", "dataset", "'_", "]_", "[_", "'", "voxel", "res", "'_", "]_", "[_", "0_", "]_", "[_", "0_", "]_", "/_", "jsonp", "roj", "info_", "[_", "'", "dataset", "'_", "]_", "[_", "'", "voxel", "res", "'_", "]_", "[_", "0_", "]_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tiles", "erver", "\\u", "element_", "=_", "etree_", "._", "Sub", "Element_", "(_", "root_", ",_", "'", "OC", "PT", "ile", "Server", "'_", ",_", "Coord", "Spac", "e", "Name_", "=_", "\"", "volume", "\"_", ",_", "host_", "=_", "\"", "http", "://", "openco", "nnect", "o", ".", "me", "/", "oc", "pti", "lec", "ache", "/", "tile", "cache", "/", "vi", "king", "/\"_", ",_", "File", "Prefix_", "=_", "\"\"_", ",_", "File", "Post", "fix_", "=_", "\".", "png", "\"_", ",_", "Til", "e", "XD", "im_", "=_", "\"", "512", "\"_", ",_", "Til", "e", "YD", "im_", "=_", "\"", "512", "\"_", ",_", "Grid", "Xd", "im_", "=_", "str_", "(_", "jsonp", "roj", "info_", "[_", "'", "dataset", "'_", "]_", "[_", "'", "images", "ize", "'_", "]_", "[_", "0_", "]_", "[_", "0_", "]_", "/_", "512_", ")_", ",_", "Grid", "YD", "im_", "=_", "str_", "(_", "jsonp", "roj", "info_", "[_", "'", "dataset", "'_", "]_", "[_", "'", "images", "ize", "'_", "]_", "[_", "0_", "]_", "[_", "1_", "]_", "/_", "512_", ")_", ",_", "Max", "Level_", "=_", "str_", "(_", "jsonp", "roj", "info_", "[_", "'", "dataset", "'_", "]_", "[_", "\"", "resolu", "tion", "s", "\"_", "]_", "[_", "-_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "channel", "\\u", "name_", "in_", "jsonp", "roj", "info_", "[_", "'", "channel", "s", "'_", "]_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "etree_", "._", "Sub", "Element_", "(_", "tiles", "erver", "\\u", "element_", ",_", "\"", "Chan", "nel", "\"_", ",_", "Name_", "=_", "channel", "\\u", "name_", ",_", "Path_", "=_", "channel", "\\u", "name_", ",_", "Datat", "ype_", "=_", "jsonp", "roj", "info_", "[_", "'", "channel", "s", "'_", "]_", "[_", "channel", "\\u", "name_", "]_", "[_", "'", "datatype", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "slice", "\\u", "number_", "in_", "range_", "(_", "jsonp", "roj", "info_", "[_", "'", "dataset", "'_", "]_", "[_", "'", "offset", "'_", "]_", "[_", "0_", "]_", "[_", "2_", "]_", ",_", "jsonp", "roj", "info_", "[_", "'", "dataset", "'_", "]_", "[_", "'", "offset", "'_", "]_", "[_", "0_", "]_", "[_", "2_", "]_", "+_", "jsonp", "roj", "info_", "[_", "'", "dataset", "'_", "]_", "[_", "'", "images", "ize", "'_", "]_", "[_", "0_", "]_", "[_", "2_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "etree_", "._", "Sub", "Element_", "(_", "root_", ",_", "\"", "Sect", "ion", "\"_", ",_", "Number_", "=_", "\"{}\"_", "._", "format_", "(_", "slice", "\\u", "number_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "etree_", "._", "tostring_", "(_", "root_", ")_", "\\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_", "metadata", "dict_", "(_", "proj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Meta", "data", " ", "Info", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "settings_", "._", "LIM", "S", "\\u", "SERVER", "\\u", "ENABLED_", ":_", "\\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 ", " _", "url_", "=_", "'", "http", "://{}", "/", "metadata", "/", "oc", "p", "/", "get", "/{}/", "'_", "._", "format_", "(_", "settings_", "._", "LIM", "S", "\\u", "SERVER_", ",_", "proj_", "._", "get", "Project", "Name_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "req_", "=_", "urllib2_", "._", "Request_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "urllib2_", "._", "urlopen_", "(_", "req_", ",_", "timeout_", "=_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "json_", "._", "loads_", "(_", "response_", "._", "read_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "urllib2_", "._", "URL", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Fail", "ed", " ", "URL", " ", "{}\"_", "._", "format_", "(_", "url_", ")_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "public", "Tokens_", "(_", "proj", "db_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "List", " ", "of", " ", "Public", " ", "Token", "s", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tokens_", "=_", "proj", "db_", "._", "get", "Public", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "json_", "._", "dumps_", "(_", "tokens_", ",_", "sort", "\\u", "keys_", "=_", "True_", ",_", "indent_", "=_", "4_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
AppScale/appscale/AppServer/lib/django-1.3/tests/regressiontests/generic_views/base.py
[ { "content": "import time\nimport unittest\n\nfrom django.core.exceptions import ImproperlyConfigured\nfrom django.http import HttpResponse\nfrom django.test import TestCase, RequestFactory\nfrom django.utils import simplejson\nfrom django.views.generic import View, TemplateView, RedirectView\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 SimpleView(View):\n \"\"\"\n A simple view with a docstring.\n \"\"\"", "metadata": "root.SimpleView", "header": "['module', '___EOS___']", "index": 10 }, { "content": " def get(self, request):\n return HttpResponse('This is a simple view')", "metadata": "root.SimpleView.get", "header": "['class', 'SimpleView', '(', 'View', ')', ':', '___EOS___']", "index": 14 }, { "content": "class SimplePostView(SimpleView):\n post = SimpleView.get", "metadata": "root.SimplePostView", "header": "['module', '___EOS___']", "index": 18 }, { "content": "class CustomizableView(SimpleView):\n parameter = {}", "metadata": "root.CustomizableView", "header": "['module', '___EOS___']", "index": 22 }, { "content": "def decorator(view):\n view.is_decorated = True\n return view", "metadata": "root.decorator", "header": "['module', '___EOS___']", "index": 25 }, { "content": "class DecoratedDispatchView(SimpleView):\n", "metadata": "root.DecoratedDispatchView", "header": "['module', '___EOS___']", "index": 30 }, { "content": " @decorator\n def dispatch(self, request, *args, **kwargs):\n return super(DecoratedDispatchView, self).dispatch(request, *args, **kwargs)", "metadata": "root.DecoratedDispatchView.dispatch", "header": "['class', 'DecoratedDispatchView', '(', 'SimpleView', ')', ':', '___EOS___']", "index": 32 }, { "content": "class AboutTemplateView(TemplateView):\n", "metadata": "root.AboutTemplateView", "header": "['module', '___EOS___']", "index": 37 }, { "content": " def get(self, request):\n return self.render_to_response({})", "metadata": "root.AboutTemplateView.get", "header": "['class', 'AboutTemplateView', '(', 'TemplateView', ')', ':', '___EOS___']", "index": 38 }, { "content": " def get_template_names(self):\n return ['generic_views/about.html']", "metadata": "root.AboutTemplateView.get_template_names", "header": "['class', 'AboutTemplateView', '(', 'TemplateView', ')', ':', '___EOS___']", "index": 41 }, { "content": "class AboutTemplateAttributeView(TemplateView):\n template_name = 'generic_views/about.html'\n", "metadata": "root.AboutTemplateAttributeView", "header": "['module', '___EOS___']", "index": 45 }, { "content": " def get(self, request):\n return self.render_to_response(context={})", "metadata": "root.AboutTemplateAttributeView.get", "header": "['class', 'AboutTemplateAttributeView', '(', 'TemplateView', ')', ':', '___EOS___']", "index": 48 }, { "content": "class InstanceView(View):\n", "metadata": "root.InstanceView", "header": "['module', '___EOS___']", "index": 52 }, { "content": " def get(self, request):\n return self", "metadata": "root.InstanceView.get", "header": "['class', 'InstanceView', '(', 'View', ')', ':', '___EOS___']", "index": 54 }, { "content": "class ViewTest(unittest.TestCase):\n rf = RequestFactory()\n\n\n\n\n\n\n\n\n\n", "metadata": "root.ViewTest", "header": "['module', '___EOS___']", "index": 58 }, { "content": " def _assert_simple(self, response):\n self.assertEqual(response.status_code, 200)\n self.assertEqual(response.content, 'This is a simple view')", "metadata": "root.ViewTest._assert_simple", "header": "['class', 'ViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 61 }, { "content": " def test_no_init_kwargs(self):\n \"\"\"\n Test that a view can't be accidentally instantiated before deployment\n \"\"\"\n try:\n view = SimpleView(key='value').as_view()\n self.fail('Should not be able to instantiate a view')\n except AttributeError:\n pass", "metadata": "root.ViewTest.test_no_init_kwargs", "header": "['class', 'ViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 65 }, { "content": " def test_no_init_args(self):\n \"\"\"\n Test that a view can't be accidentally instantiated before deployment\n \"\"\"\n try:\n view = SimpleView.as_view('value')\n self.fail('Should not be able to use non-keyword arguments instantiating a view')\n except TypeError:\n pass", "metadata": "root.ViewTest.test_no_init_args", "header": "['class', 'ViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 75 }, { "content": " def test_pathological_http_method(self):\n \"\"\"\n The edge case of a http request that spoofs an existing method name is caught.\n \"\"\"\n self.assertEqual(SimpleView.as_view()(\n self.rf.get('/', REQUEST_METHOD='DISPATCH')\n ).status_code, 405)", "metadata": "root.ViewTest.test_pathological_http_method", "header": "['class', 'ViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 85 }, { "content": " def test_get_only(self):\n \"\"\"\n Test a view which only allows GET doesn't allow other methods.\n \"\"\"\n self._assert_simple(SimpleView.as_view()(self.rf.get('/')))\n self.assertEqual(SimpleView.as_view()(self.rf.post('/')).status_code, 405)\n self.assertEqual(SimpleView.as_view()(\n self.rf.get('/', REQUEST_METHOD='FAKE')\n ).status_code, 405)", "metadata": "root.ViewTest.test_get_only", "header": "['class', 'ViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 93 }, { "content": " def test_get_and_post(self):\n \"\"\"\n Test a view which only allows both GET and POST.\n \"\"\"\n self._assert_simple(SimplePostView.as_view()(self.rf.get('/')))\n self._assert_simple(SimplePostView.as_view()(self.rf.post('/')))\n self.assertEqual(SimplePostView.as_view()(\n self.rf.get('/', REQUEST_METHOD='FAKE')\n ).status_code, 405)", "metadata": "root.ViewTest.test_get_and_post", "header": "['class', 'ViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 103 }, { "content": " def test_invalid_keyword_argument(self):\n \"\"\"\n Test that view arguments must be predefined on the class and can't\n be named like a HTTP method.\n \"\"\"\n # Check each of the allowed method names\n for method in SimpleView.http_method_names:\n kwargs = dict(((method, \"value\"),))\n self.assertRaises(TypeError, SimpleView.as_view, **kwargs)\n\n # Check the case view argument is ok if predefined on the class...\n CustomizableView.as_view(parameter=\"value\")\n # ...but raises errors otherwise.\n self.assertRaises(TypeError, CustomizableView.as_view, foobar=\"value\")", "metadata": "root.ViewTest.test_invalid_keyword_argument", "header": "['class', 'ViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 113 }, { "content": " def test_calling_more_than_once(self):\n \"\"\"\n Test a view can only be called once.\n \"\"\"\n request = self.rf.get('/')\n view = InstanceView.as_view()\n self.assertNotEqual(view(request), view(request))", "metadata": "root.ViewTest.test_calling_more_than_once", "header": "['class', 'ViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 128 }, { "content": " def test_class_attributes(self):\n \"\"\"\n Test that the callable returned from as_view() has proper\n docstring, name and module.\n \"\"\"\n self.assertEqual(SimpleView.__doc__, SimpleView.as_view().__doc__)\n self.assertEqual(SimpleView.__name__, SimpleView.as_view().__name__)\n self.assertEqual(SimpleView.__module__, SimpleView.as_view().__module__)", "metadata": "root.ViewTest.test_class_attributes", "header": "['class', 'ViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 136 }, { "content": " def test_dispatch_decoration(self):\n \"\"\"\n Test that attributes set by decorators on the dispatch method\n are also present on the closure.\n \"\"\"\n self.assertTrue(DecoratedDispatchView.as_view().is_decorated)", "metadata": "root.ViewTest.test_dispatch_decoration", "header": "['class', 'ViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 145 }, { "content": "class TemplateViewTest(TestCase):\n urls = 'regressiontests.generic_views.urls'\n\n rf = RequestFactory()\n\n\n\n\n\n\n\n", "metadata": "root.TemplateViewTest", "header": "['module', '___EOS___']", "index": 153 }, { "content": " def _assert_about(self, response):\n response.render()\n self.assertEqual(response.status_code, 200)\n self.assertContains(response, '<h1>About</h1>')", "metadata": "root.TemplateViewTest._assert_about", "header": "['class', 'TemplateViewTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 158 }, { "content": " def test_get(self):\n \"\"\"\n Test a view that simply renders a template on GET\n \"\"\"\n self._assert_about(AboutTemplateView.as_view()(self.rf.get('/about/')))", "metadata": "root.TemplateViewTest.test_get", "header": "['class', 'TemplateViewTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 163 }, { "content": " def test_get_template_attribute(self):\n \"\"\"\n Test a view that renders a template on GET with the template name as\n an attribute on the class.\n \"\"\"\n self._assert_about(AboutTemplateAttributeView.as_view()(self.rf.get('/about/')))", "metadata": "root.TemplateViewTest.test_get_template_attribute", "header": "['class', 'TemplateViewTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 169 }, { "content": " def test_get_generic_template(self):\n \"\"\"\n Test a completely generic view that renders a template on GET\n with the template name as an argument at instantiation.\n \"\"\"\n self._assert_about(TemplateView.as_view(template_name='generic_views/about.html')(self.rf.get('/about/')))", "metadata": "root.TemplateViewTest.test_get_generic_template", "header": "['class', 'TemplateViewTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 176 }, { "content": " def test_template_name_required(self):\n \"\"\"\n A template view must provide a template name\n \"\"\"\n self.assertRaises(ImproperlyConfigured, self.client.get, '/template/no_template/')", "metadata": "root.TemplateViewTest.test_template_name_required", "header": "['class', 'TemplateViewTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 183 }, { "content": " def test_template_params(self):\n \"\"\"\n A generic template view passes kwargs as context.\n \"\"\"\n response = self.client.get('/template/simple/bar/')\n self.assertEqual(response.status_code, 200)\n self.assertEqual(response.context['params'], {'foo': 'bar'})", "metadata": "root.TemplateViewTest.test_template_params", "header": "['class', 'TemplateViewTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 189 }, { "content": " def test_extra_template_params(self):\n \"\"\"\n A template view can be customized to return extra context.\n \"\"\"\n response = self.client.get('/template/custom/bar/')\n self.assertEqual(response.status_code, 200)\n self.assertEqual(response.context['params'], {'foo': 'bar'})\n self.assertEqual(response.context['key'], 'value')", "metadata": "root.TemplateViewTest.test_extra_template_params", "header": "['class', 'TemplateViewTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 197 }, { "content": " def test_cached_views(self):\n \"\"\"\n A template view can be cached\n \"\"\"\n response = self.client.get('/template/cached/bar/')\n self.assertEqual(response.status_code, 200)\n\n time.sleep(1.0)\n\n response2 = self.client.get('/template/cached/bar/')\n self.assertEqual(response2.status_code, 200)\n\n self.assertEqual(response.content, response2.content)\n\n time.sleep(2.0)\n\n # Let the cache expire and test again\n response2 = self.client.get('/template/cached/bar/')\n self.assertEqual(response2.status_code, 200)\n\n self.assertNotEqual(response.content, response2.content)", "metadata": "root.TemplateViewTest.test_cached_views", "header": "['class', 'TemplateViewTest', '(', 'TestCase', ')', ':', '___EOS___']", "index": 206 }, { "content": "class RedirectViewTest(unittest.TestCase):\n rf = RequestFactory()\n\n\n\n\n\n\n\n\n\n", "metadata": "root.RedirectViewTest", "header": "['module', '___EOS___']", "index": 228 }, { "content": " def test_no_url(self):\n \"Without any configuration, returns HTTP 410 GONE\"\n response = RedirectView.as_view()(self.rf.get('/foo/'))\n self.assertEqual(response.status_code, 410)", "metadata": "root.RedirectViewTest.test_no_url", "header": "['class', 'RedirectViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 231 }, { "content": " def test_permanaent_redirect(self):\n \"Default is a permanent redirect\"\n response = RedirectView.as_view(url='/bar/')(self.rf.get('/foo/'))\n self.assertEqual(response.status_code, 301)\n self.assertEqual(response['Location'], '/bar/')", "metadata": "root.RedirectViewTest.test_permanaent_redirect", "header": "['class', 'RedirectViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 236 }, { "content": " def test_temporary_redirect(self):\n \"Permanent redirects are an option\"\n response = RedirectView.as_view(url='/bar/', permanent=False)(self.rf.get('/foo/'))\n self.assertEqual(response.status_code, 302)\n self.assertEqual(response['Location'], '/bar/')", "metadata": "root.RedirectViewTest.test_temporary_redirect", "header": "['class', 'RedirectViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 242 }, { "content": " def test_include_args(self):\n \"GET arguments can be included in the redirected URL\"\n response = RedirectView.as_view(url='/bar/')(self.rf.get('/foo/'))\n self.assertEqual(response.status_code, 301)\n self.assertEqual(response['Location'], '/bar/')\n\n response = RedirectView.as_view(url='/bar/', query_string=True)(self.rf.get('/foo/?pork=spam'))\n self.assertEqual(response.status_code, 301)\n self.assertEqual(response['Location'], '/bar/?pork=spam')", "metadata": "root.RedirectViewTest.test_include_args", "header": "['class', 'RedirectViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 248 }, { "content": " def test_parameter_substitution(self):\n \"Redirection URLs can be parameterized\"\n response = RedirectView.as_view(url='/bar/%(object_id)d/')(self.rf.get('/foo/42/'), object_id=42)\n self.assertEqual(response.status_code, 301)\n self.assertEqual(response['Location'], '/bar/42/')", "metadata": "root.RedirectViewTest.test_parameter_substitution", "header": "['class', 'RedirectViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 258 }, { "content": " def test_redirect_POST(self):\n \"Default is a permanent redirect\"\n response = RedirectView.as_view(url='/bar/')(self.rf.post('/foo/'))\n self.assertEqual(response.status_code, 301)\n self.assertEqual(response['Location'], '/bar/')", "metadata": "root.RedirectViewTest.test_redirect_POST", "header": "['class', 'RedirectViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 264 }, { "content": " def test_redirect_HEAD(self):\n \"Default is a permanent redirect\"\n response = RedirectView.as_view(url='/bar/')(self.rf.head('/foo/'))\n self.assertEqual(response.status_code, 301)\n self.assertEqual(response['Location'], '/bar/')", "metadata": "root.RedirectViewTest.test_redirect_HEAD", "header": "['class', 'RedirectViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 270 }, { "content": " def test_redirect_OPTIONS(self):\n \"Default is a permanent redirect\"\n response = RedirectView.as_view(url='/bar/')(self.rf.options('/foo/'))\n self.assertEqual(response.status_code, 301)\n self.assertEqual(response['Location'], '/bar/')", "metadata": "root.RedirectViewTest.test_redirect_OPTIONS", "header": "['class', 'RedirectViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 276 }, { "content": " def test_redirect_PUT(self):\n \"Default is a permanent redirect\"\n response = RedirectView.as_view(url='/bar/')(self.rf.put('/foo/'))\n self.assertEqual(response.status_code, 301)\n self.assertEqual(response['Location'], '/bar/')", "metadata": "root.RedirectViewTest.test_redirect_PUT", "header": "['class', 'RedirectViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 282 }, { "content": " def test_redirect_DELETE(self):\n \"Default is a permanent redirect\"\n response = RedirectView.as_view(url='/bar/')(self.rf.delete('/foo/'))\n self.assertEqual(response.status_code, 301)\n self.assertEqual(response['Location'], '/bar/')", "metadata": "root.RedirectViewTest.test_redirect_DELETE", "header": "['class', 'RedirectViewTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 288 } ]
[ { "span": "from django.utils import simplejson", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 35 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\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_", "django_", "._", "core_", "._", "exceptions_", "import_", "Impro", "perl", "y", "Configured_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "http_", "import_", "Http", "Response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "test_", "import_", "Test", "Case_", ",_", "Request", "Factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "import_", "simplejson_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "views_", "._", "generic_", "import_", "View_", ",_", "Templa", "te", "View_", ",_", "Redirect", "View_", "\\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\\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_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Simple", "View_", "(_", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "simple", " ", "view", " ", "with", " ", "a", " ", "docstr", "ing", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Simple", "View_", "(_", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Http", "Response_", "(_", "'", "Thi", "s", " ", "is", " ", "a", " ", "simple", " ", "view", "'_", ")_", "\\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", "Post", "View_", "(_", "Simple", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "post_", "=_", "Simple", "View_", "._", "get_", "\\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_", "Customiz", "able", "View_", "(_", "Simple", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "parameter_", "=_", "{_", "}_", "\\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_", "decorator_", "(_", "view_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view_", "._", "is", "\\u", "decorated_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "view_", "\\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_", "Decorat", "ed", "Dispa", "tch", "View_", "(_", "Simple", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Decorat", "ed", "Dispa", "tch", "View_", "(_", "Simple", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "decorator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "dispatch_", "(_", "self_", ",_", "request_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "super_", "(_", "Decorat", "ed", "Dispa", "tch", "View_", ",_", "self_", ")_", "._", "dispatch_", "(_", "request_", ",_", "*_", "args_", ",_", "**_", "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_", "Abo", "ut", "Templa", "te", "View_", "(_", "Templa", "te", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Abo", "ut", "Templa", "te", "View_", "(_", "Templa", "te", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "render", "\\u", "to", "\\u", "response_", "(_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Abo", "ut", "Templa", "te", "View_", "(_", "Templa", "te", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "template", "\\u", "names_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "'", "gener", "ic", "\\u", "views", "/", "abo", "ut", ".", "html", "'_", "]_", "\\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_", "Abo", "ut", "Templa", "te", "Attribute", "View_", "(_", "Templa", "te", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template", "\\u", "name_", "=_", "'", "gener", "ic", "\\u", "views", "/", "abo", "ut", ".", "html", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Abo", "ut", "Templa", "te", "Attribute", "View_", "(_", "Templa", "te", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "render", "\\u", "to", "\\u", "response_", "(_", "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_", "Insta", "nce", "View_", "(_", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Insta", "nce", "View_", "(_", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "get_", "(_", "self_", ",_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "View", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rf_", "=_", "Request", "Factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "View", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "assert", "\\u", "simple_", "(_", "self_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "content_", ",_", "'", "Thi", "s", " ", "is", " ", "a", " ", "simple", " ", "view", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "View", "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", "no", "\\u", "init", "\\u", "kwargs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "a", " ", "view", " ", "can", "'", "t", " ", "be", " ", "accident", "ally", " ", "instantiate", "d", " ", "bef", "ore", " ", "deploy", "ment", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view_", "=_", "Simple", "View_", "(_", "key_", "=_", "'", "value", "'_", ")_", "._", "as", "\\u", "view_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "'", "Sho", "ul", "d", " ", "not", " ", "be", " ", "able", " ", "to", " ", "instantiate", " ", "a", " ", "view", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "View", "Test_", "(_", "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", "no", "\\u", "init", "\\u", "args_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "a", " ", "view", " ", "can", "'", "t", " ", "be", " ", "accident", "ally", " ", "instantiate", "d", " ", "bef", "ore", " ", "deploy", "ment", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "view_", "=_", "Simple", "View_", "._", "as", "\\u", "view_", "(_", "'", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "'", "Sho", "ul", "d", " ", "not", " ", "be", " ", "able", " ", "to", " ", "use", " ", "non", "-", "keyw", "ord", " ", "argu", "ment", "s", " ", "instant", "iati", "ng", " ", "a", " ", "view", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "View", "Test_", "(_", "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", "patho", "logical", "\\u", "http", "\\u", "method_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "edge", " ", "case", " ", "of", " ", "a", " ", "http", " ", "request", " ", "tha", "t", " ", "spoo", "fs", " ", "an", " ", "exist", "ing", " ", "method", " ", "name", " ", "is", " ", "cau", "ght", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Simple", "View_", "._", "as", "\\u", "view_", "(_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "rf_", "._", "get_", "(_", "'/'_", ",_", "REQUEST", "\\u", "METHOD_", "=_", "'", "DISP", "ATCH", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "status", "\\u", "code_", ",_", "405_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "View", "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", "get", "\\u", "only_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "a", " ", "view", " ", "whi", "ch", " ", "only", " ", "allow", "s", " ", "GET", " ", "doe", "sn", "'", "t", " ", "allow", " ", "other", " ", "method", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "\\u", "simple_", "(_", "Simple", "View_", "._", "as", "\\u", "view_", "(_", ")_", "(_", "self_", "._", "rf_", "._", "get_", "(_", "'/'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Simple", "View_", "._", "as", "\\u", "view_", "(_", ")_", "(_", "self_", "._", "rf_", "._", "post_", "(_", "'/'_", ")_", ")_", "._", "status", "\\u", "code_", ",_", "405_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Simple", "View_", "._", "as", "\\u", "view_", "(_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "rf_", "._", "get_", "(_", "'/'_", ",_", "REQUEST", "\\u", "METHOD_", "=_", "'", "FAKE", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "status", "\\u", "code_", ",_", "405_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "View", "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", "get", "\\u", "and", "\\u", "post_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "a", " ", "view", " ", "whi", "ch", " ", "only", " ", "allow", "s", " ", "bot", "h", " ", "GET", " ", "and", " ", "POST", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "\\u", "simple_", "(_", "Simple", "Post", "View_", "._", "as", "\\u", "view_", "(_", ")_", "(_", "self_", "._", "rf_", "._", "get_", "(_", "'/'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "\\u", "simple_", "(_", "Simple", "Post", "View_", "._", "as", "\\u", "view_", "(_", ")_", "(_", "self_", "._", "rf_", "._", "post_", "(_", "'/'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Simple", "Post", "View_", "._", "as", "\\u", "view_", "(_", ")_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "rf_", "._", "get_", "(_", "'/'_", ",_", "REQUEST", "\\u", "METHOD_", "=_", "'", "FAKE", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "status", "\\u", "code_", ",_", "405_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "View", "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", "invalid", "\\u", "keyw", "ord", "\\u", "argument_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "view", " ", "argu", "ment", "s", " ", "must", " ", "be", " ", "prede", "fined", " ", "on", " ", "the", " ", "class", " ", "and", " ", "can", "'", "t", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "named", " ", "like", " ", "a", " ", "HTTP", " ", "method", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "each", " ", "of", " ", "the", " ", "allow", "ed", " ", "method", " ", "names_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "method_", "in_", "Simple", "View_", "._", "http", "\\u", "method", "\\u", "names_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "=_", "dict_", "(_", "(_", "(_", "method_", ",_", "\"", "value", "\"_", ")_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "Simple", "View_", "._", "as", "\\u", "view_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "the", " ", "case", " ", "view", " ", "argu", "ment", " ", "is", " ", "ok", " ", "if", " ", "prede", "fined", " ", "on", " ", "the", " ", "class", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Customiz", "able", "View_", "._", "as", "\\u", "view_", "(_", "parameter_", "=_", "\"", "value", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "...", "but", " ", "raise", "s", " ", "error", "s", " ", "other", "wis", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "Customiz", "able", "View_", "._", "as", "\\u", "view_", ",_", "fooba", "r_", "=_", "\"", "value", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "View", "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", "calling", "\\u", "more", "\\u", "than", "\\u", "once_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "a", " ", "view", " ", "can", " ", "only", " ", "be", " ", "call", "ed", " ", "onc", "e", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "request_", "=_", "self_", "._", "rf_", "._", "get_", "(_", "'/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "view_", "=_", "Insta", "nce", "View_", "._", "as", "\\u", "view_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "view_", "(_", "request_", ")_", ",_", "view_", "(_", "request_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "View", "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", "class", "\\u", "attributes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "the", " ", "calla", "ble", " ", "return", "ed", " ", "from", " ", "as", "\\u", "view", "()", " ", "has", " ", "proper", "\\", "10", ";", " ", " ", " ", " ", "docstr", "ing", ",", " ", "name", " ", "and", " ", "module", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Simple", "View_", "._", "\\u\\u", "doc\\u\\u_", ",_", "Simple", "View_", "._", "as", "\\u", "view_", "(_", ")_", "._", "\\u\\u", "doc\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Simple", "View_", "._", "\\u\\u", "name\\u\\u_", ",_", "Simple", "View_", "._", "as", "\\u", "view_", "(_", ")_", "._", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "Simple", "View_", "._", "\\u\\u", "module\\u\\u_", ",_", "Simple", "View_", "._", "as", "\\u", "view_", "(_", ")_", "._", "\\u\\u", "module\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "View", "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", "dispatch", "\\u", "decorat", "ion_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "tha", "t", " ", "attribute", "s", " ", "set", " ", "by", " ", "decorat", "ors", " ", "on", " ", "the", " ", "dispatch", " ", "method", "\\", "10", ";", " ", " ", " ", " ", "are", " ", "als", "o", " ", "presen", "t", " ", "on", " ", "the", " ", "clos", "ure", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "Decorat", "ed", "Dispa", "tch", "View_", "._", "as", "\\u", "view_", "(_", ")_", "._", "is", "\\u", "decorated_", ")_", "\\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_", "Templa", "te", "View", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "urls_", "=_", "'", "regress", "ion", "tests", ".", "gener", "ic", "\\u", "views", ".", "urls", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rf_", "=_", "Request", "Factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Templa", "te", "View", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "assert", "\\u", "about_", "(_", "self_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "._", "render_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Contains_", "(_", "response_", ",_", "'<", "h1", ">", "Abo", "ut", "</", "h1", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Templa", "te", "View", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "a", " ", "view", " ", "tha", "t", " ", "simp", "ly", " ", "render", "s", " ", "a", " ", "template", " ", "on", " ", "GET", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "\\u", "about_", "(_", "Abo", "ut", "Templa", "te", "View_", "._", "as", "\\u", "view_", "(_", ")_", "(_", "self_", "._", "rf_", "._", "get_", "(_", "'/", "abo", "ut", "/'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Templa", "te", "View", "Test_", "(_", "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", "template", "\\u", "attribute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "a", " ", "view", " ", "tha", "t", " ", "render", "s", " ", "a", " ", "template", " ", "on", " ", "GET", " ", "with", " ", "the", " ", "template", " ", "name", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "an", " ", "attribute", " ", "on", " ", "the", " ", "class", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "\\u", "about_", "(_", "Abo", "ut", "Templa", "te", "Attribute", "View_", "._", "as", "\\u", "view_", "(_", ")_", "(_", "self_", "._", "rf_", "._", "get_", "(_", "'/", "abo", "ut", "/'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Templa", "te", "View", "Test_", "(_", "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", "gener", "ic", "\\u", "template_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "a", " ", "complete", "ly", " ", "gener", "ic", " ", "view", " ", "tha", "t", " ", "render", "s", " ", "a", " ", "template", " ", "on", " ", "GET", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "the", " ", "template", " ", "name", " ", "as", " ", "an", " ", "argu", "ment", " ", "at", " ", "instantiation", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "assert", "\\u", "about_", "(_", "Templa", "te", "View_", "._", "as", "\\u", "view_", "(_", "template", "\\u", "name_", "=_", "'", "gener", "ic", "\\u", "views", "/", "abo", "ut", ".", "html", "'_", ")_", "(_", "self_", "._", "rf_", "._", "get_", "(_", "'/", "abo", "ut", "/'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Templa", "te", "View", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "template", "\\u", "name", "\\u", "required_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "template", " ", "view", " ", "must", " ", "provide", " ", "a", " ", "template", " ", "name", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Impro", "perl", "y", "Configured_", ",_", "self_", "._", "client_", "._", "get_", ",_", "'/", "template", "/", "no", "\\u", "template", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Templa", "te", "View", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "template", "\\u", "params_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "gener", "ic", " ", "template", " ", "view", " ", "pass", "es", " ", "kwarg", "s", " ", "as", " ", "context", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "template", "/", "simple", "/", "bar", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "context_", "[_", "'", "params", "'_", "]_", ",_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Templa", "te", "View", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "extra", "\\u", "template", "\\u", "params_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "template", " ", "view", " ", "can", " ", "be", " ", "customize", "d", " ", "to", " ", "return", " ", "extra", " ", "context", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "template", "/", "custom", "/", "bar", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "context_", "[_", "'", "params", "'_", "]_", ",_", "{_", "'", "foo", "'_", ":_", "'", "bar", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "context_", "[_", "'", "key", "'_", "]_", ",_", "'", "value", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Templa", "te", "View", "Test_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cache", "d\\u", "views_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "template", " ", "view", " ", "can", " ", "be", " ", "cache", "d", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "template", "/", "cache", "d", "/", "bar", "/'_", ")_", "\\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_", "time_", "._", "sleep_", "(_", "1.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response", "2_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "template", "/", "cache", "d", "/", "bar", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response", "2_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "content_", ",_", "response", "2_", "._", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "time_", "._", "sleep_", "(_", "2.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Let", " ", "the", " ", "cache", " ", "expir", "e", " ", "and", " ", "test", " ", "again", "_", "\\u\\u\\uNL\\u\\u\\u_", "response", "2_", "=_", "self_", "._", "client_", "._", "get_", "(_", "'/", "template", "/", "cache", "d", "/", "bar", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response", "2_", "._", "status", "\\u", "code_", ",_", "200_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "response_", "._", "content_", ",_", "response", "2_", "._", "content_", ")_", "\\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_", "Redirect", "View", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rf_", "=_", "Request", "Factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Redirect", "View", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "no", "\\u", "url_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "With", "out", " ", "any", " ", "configura", "tion", ",", " ", "return", "s", " ", "HTTP", " ", "410", " ", "GO", "NE", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "Redirect", "View_", "._", "as", "\\u", "view_", "(_", ")_", "(_", "self_", "._", "rf_", "._", "get_", "(_", "'/", "foo", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "410", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Redirect", "View", "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", "perm", "ana", "ent", "\\u", "redirect_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Default", " ", "is", " ", "a", " ", "permanent", " ", "redirec", "t", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "Redirect", "View_", "._", "as", "\\u", "view_", "(_", "url_", "=_", "'/", "bar", "/'_", ")_", "(_", "self_", "._", "rf_", "._", "get_", "(_", "'/", "foo", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "301_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ",_", "'/", "bar", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Redirect", "View", "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", "temporar", "y", "\\u", "redirect_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Permanent", " ", "redirec", "ts", " ", "are", " ", "an", " ", "option", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "Redirect", "View_", "._", "as", "\\u", "view_", "(_", "url_", "=_", "'/", "bar", "/'_", ",_", "permanent", "_", "=_", "False_", ")_", "(_", "self_", "._", "rf_", "._", "get_", "(_", "'/", "foo", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "302_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ",_", "'/", "bar", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Redirect", "View", "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", "include", "\\u", "args_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "GET", " ", "argu", "ment", "s", " ", "can", " ", "be", " ", "include", "d", " ", "in", " ", "the", " ", "redirected", " ", "URL", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "Redirect", "View_", "._", "as", "\\u", "view_", "(_", "url_", "=_", "'/", "bar", "/'_", ")_", "(_", "self_", "._", "rf_", "._", "get_", "(_", "'/", "foo", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "301_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ",_", "'/", "bar", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "Redirect", "View_", "._", "as", "\\u", "view_", "(_", "url_", "=_", "'/", "bar", "/'_", ",_", "query", "\\u", "string_", "=_", "True_", ")_", "(_", "self_", "._", "rf_", "._", "get_", "(_", "'/", "foo", "/?", "por", "k", "=", "spam", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "301_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ",_", "'/", "bar", "/?", "por", "k", "=", "spam", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Redirect", "View", "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", "parameter", "\\u", "substitution", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Redirect", "ion", " ", "URL", "s", " ", "can", " ", "be", " ", "parameterize", "d", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "Redirect", "View_", "._", "as", "\\u", "view_", "(_", "url_", "=_", "'/", "bar", "/", "%", "(", "object\\u", "id", ")", "d", "/'_", ")_", "(_", "self_", "._", "rf_", "._", "get_", "(_", "'/", "foo", "/", "4", "2", "/'_", ")_", ",_", "object\\u", "id_", "=_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "301_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ",_", "'/", "bar", "/", "4", "2", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Redirect", "View", "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", "redirec", "t", "\\u", "POST_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Default", " ", "is", " ", "a", " ", "permanent", " ", "redirec", "t", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "Redirect", "View_", "._", "as", "\\u", "view_", "(_", "url_", "=_", "'/", "bar", "/'_", ")_", "(_", "self_", "._", "rf_", "._", "post_", "(_", "'/", "foo", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "301_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ",_", "'/", "bar", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Redirect", "View", "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", "redirec", "t", "\\u", "HEAD_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Default", " ", "is", " ", "a", " ", "permanent", " ", "redirec", "t", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "Redirect", "View_", "._", "as", "\\u", "view_", "(_", "url_", "=_", "'/", "bar", "/'_", ")_", "(_", "self_", "._", "rf_", "._", "head_", "(_", "'/", "foo", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "301_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ",_", "'/", "bar", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Redirect", "View", "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", "redirec", "t", "\\u", "OPTIONS_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Default", " ", "is", " ", "a", " ", "permanent", " ", "redirec", "t", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "Redirect", "View_", "._", "as", "\\u", "view_", "(_", "url_", "=_", "'/", "bar", "/'_", ")_", "(_", "self_", "._", "rf_", "._", "options_", "(_", "'/", "foo", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "301_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ",_", "'/", "bar", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Redirect", "View", "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", "redirec", "t", "\\u", "PUT_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Default", " ", "is", " ", "a", " ", "permanent", " ", "redirec", "t", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "Redirect", "View_", "._", "as", "\\u", "view_", "(_", "url_", "=_", "'/", "bar", "/'_", ")_", "(_", "self_", "._", "rf_", "._", "put_", "(_", "'/", "foo", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "301_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ",_", "'/", "bar", "/'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Redirect", "View", "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", "redirec", "t", "\\u", "DELETE_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Default", " ", "is", " ", "a", " ", "permanent", " ", "redirec", "t", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "Redirect", "View_", "._", "as", "\\u", "view_", "(_", "url_", "=_", "'/", "bar", "/'_", ")_", "(_", "self_", "._", "rf_", "._", "delete_", "(_", "'/", "foo", "/'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "._", "status", "\\u", "code_", ",_", "301_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "response_", "[_", "'", "Locat", "ion", "'_", "]_", ",_", "'/", "bar", "/'_", ")_" ]
[ 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, 0, 1, 1, 1, 1, 1,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
appcelerator-archive/poc-nodejs-desktop/Resources/nodejs/builds/linux/node/lib/node/wafadmin/Tools/python.py
[ { "content": "@conf\ndef check_python_version(conf, minver=None):\n\t\"\"\"\n\tCheck if the python interpreter is found matching a given minimum version.\n\tminver should be a tuple, eg. to check for python >= 2.4.2 pass (2,4,2) as minver.\n\n\tIf successful, PYTHON_VERSION is defined as 'MAJOR.MINOR'\n\t(eg. '2.4') of the actual python version found, and PYTHONDIR is\n\tdefined, pointing to the site-packages directory appropriate for\n\tthis python version, where modules/packages/extensions should be\n\tinstalled.\n\t\"\"\"\n\tassert minver is None or isinstance(minver, tuple)\n\tpython = conf.env['PYTHON']\n\tif not python:\n\t\tconf.fatal('could not find the python executable')\n\n\t# Get python version string\n\tcmd = [python, \"-c\", \"import sys\\nfor x in sys.version_info: print(str(x))\"]\n\tdebug('python: Running python command %r' % cmd)\n\tproc = Utils.pproc.Popen(cmd, stdout=Utils.pproc.PIPE)\n\tlines = proc.communicate()[0].split()\n\tassert len(lines) == 5, \"found %i lines, expected 5: %r\" % (len(lines), lines)\n\tpyver_tuple = (int(lines[0]), int(lines[1]), int(lines[2]), lines[3], int(lines[4]))\n\n\t# compare python version with the minimum required\n\tresult = (minver is None) or (pyver_tuple >= minver)\n\n\tif result:\n\t\t# define useful environment variables\n\t\tpyver = '.'.join([str(x) for x in pyver_tuple[:2]])\n\t\tconf.env['PYTHON_VERSION'] = pyver\n\n\t\tif 'PYTHONDIR' in conf.environ:\n\t\t\tpydir = conf.environ['PYTHONDIR']\n\t\telse:\n\t\t\tif sys.platform == 'win32':\n\t\t\t\t(python_LIBDEST, pydir) = \\\n\t\t\t\t\t\t_get_python_variables(python,\n\t\t\t\t\t\t\t\t\t\t\t [\"get_config_var('LIBDEST')\",\n\t\t\t\t\t\t\t\t\t\t\t \"get_python_lib(standard_lib=0, prefix=%r)\" % conf.env['PREFIX']],\n\t\t\t\t\t\t\t\t\t\t\t ['from distutils.sysconfig import get_config_var, get_python_lib'])\n\t\t\telse:\n\t\t\t\tpython_LIBDEST = None\n\t\t\t\t(pydir,) = \\\n\t\t\t\t\t\t_get_python_variables(python,\n\t\t\t\t\t\t\t\t\t\t\t [\"get_python_lib(standard_lib=0, prefix=%r)\" % conf.env['PREFIX']],\n\t\t\t\t\t\t\t\t\t\t\t ['from distutils.sysconfig import get_config_var, get_python_lib'])\n\t\t\tif python_LIBDEST is None:\n\t\t\t\tif conf.env['LIBDIR']:\n\t\t\t\t\tpython_LIBDEST = os.path.join(conf.env['LIBDIR'], \"python\" + pyver)\n\t\t\t\telse:\n\t\t\t\t\tpython_LIBDEST = os.path.join(conf.env['PREFIX'], \"lib\", \"python\" + pyver)\n\n\t\tif hasattr(conf, 'define'): # conf.define is added by the C tool, so may not exist\n\t\t\tconf.define('PYTHONDIR', pydir)\n\t\tconf.env['PYTHONDIR'] = pydir\n\n\t# Feedback\n\tpyver_full = '.'.join(map(str, pyver_tuple[:3]))\n\tif minver is None:\n\t\tconf.check_message_custom('Python version', '', pyver_full)\n\telse:\n\t\tminver_str = '.'.join(map(str, minver))\n\t\tconf.check_message('Python version', \">= %s\" % minver_str, result, option=pyver_full)\n\n\tif not result:\n\t\tconf.fatal('The python version is too old (%r)' % pyver_full)", "metadata": "root.check_python_version", "header": "['module', '___EOS___']", "index": 291 } ]
[ { "span": "python_LIBDEST ", "start_line": 341, "start_column": 5, "end_line": 341, "end_column": 19 }, { "span": "python_LIBDEST ", "start_line": 343, "start_column": 5, "end_line": 343, "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_", "@_", "conf_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "check", "\\u", "python", "\\u", "version_", "(_", "conf_", ",_", "minv", "er_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "_", "\"\"\"", "\\", "10", ";", "\t", "Check", " ", "if", " ", "the", " ", "python", " ", "interprete", "r", " ", "is", " ", "found", " ", "matchi", "ng", " ", "a", " ", "give", "n", " ", "minim", "um", " ", "version", ".", "\\", "10", ";", "\t", "minv", "er", " ", "shou", "ld", " ", "be", " ", "a", " ", "tuple", ",", " ", "eg", ".", " ", "to", " ", "check", " ", "for", " ", "python", " ", ">=", " ", "2.4", ".2", " ", "pass", " ", "(", "2", ",", "4", ",", "2", ")", " ", "as", " ", "minv", "er", ".", "\\", "10", ";", "\\", "10", ";", "\t", "If", " ", "success", "ful", ",", " ", "PYTHON", "\\u", "VERSI", "ON", " ", "is", " ", "defin", "ed", " ", "as", " ", "'", "MAJOR", ".", "MINOR", "'", "\\", "10", ";", "\t", "(", "eg", ".", " ", "'", "2.4", "')", " ", "of", " ", "the", " ", "actual", " ", "python", " ", "version", " ", "found", ",", " ", "and", " ", "PYTHON", "DIR", " ", "is", "\\", "10", ";", "\t", "defin", "ed", ",", " ", "pointi", "ng", " ", "to", " ", "the", " ", "site", "-", "package", "s", " ", "director", "y", " ", "appropr", "iate", " ", "for", "\\", "10", ";", "\t", "this", " ", "python", " ", "version", ",", " ", "where", " ", "module", "s", "/", "package", "s", "/", "extensi", "ons", " ", "shou", "ld", " ", "be", "\\", "10", ";", "\t", "install", "ed", ".", "\\", "10", ";", "\t", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "minv", "er_", "is_", "None_", "or_", "isinstance_", "(_", "minv", "er_", ",_", "tuple_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "python_", "=_", "conf_", "._", "env_", "[_", "'", "PYTHON", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "python_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "conf_", "._", "fatal_", "(_", "'", "coul", "d", " ", "not", " ", "find", " ", "the", " ", "python", " ", "executable", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "python", " ", "version", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmd_", "=_", "[_", "python_", ",_", "\"-", "c", "\"_", ",_", "\"", "import", " ", "sys", "\\\\", "nfo", "r", " ", "x", " ", "in", " ", "sys", ".", "version", "\\u", "info", ":", " ", "print", "(", "str", "(", "x", "))\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "debug_", "(_", "'", "python", ":", " ", "Run", "ning", " ", "python", " ", "command", " ", "%", "r", "'_", "%_", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "proc_", "=_", "Utils_", "._", "ppro", "c_", "._", "Popen_", "(_", "cmd_", ",_", "stdout_", "=_", "Utils_", "._", "ppro", "c_", "._", "PIPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lines_", "=_", "proc_", "._", "communicate_", "(_", ")_", "[_", "0_", "]_", "._", "split_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "lines_", ")_", "==_", "5_", ",_", "\"", "found", " ", "%", "i", " ", "lines", ",", " ", "expected", " ", "5", ":", " ", "%", "r", "\"_", "%_", "(_", "len_", "(_", "lines_", ")_", ",_", "lines_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pyv", "er", "\\u", "tuple_", "=_", "(_", "int_", "(_", "lines_", "[_", "0_", "]_", ")_", ",_", "int_", "(_", "lines_", "[_", "1_", "]_", ")_", ",_", "int_", "(_", "lines_", "[_", "2_", "]_", ")_", ",_", "lines_", "[_", "3_", "]_", ",_", "int_", "(_", "lines_", "[_", "4_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compare", " ", "python", " ", "version", " ", "with", " ", "the", " ", "minim", "um", " ", "required_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "(_", "minv", "er_", "is_", "None_", ")_", "or_", "(_", "pyv", "er", "\\u", "tuple_", ">=_", "minv", "er_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "defin", "e", " ", "usef", "ul", " ", "environ", "ment", " ", "variables_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "pyv", "er_", "=_", "'.'_", "._", "join_", "(_", "[_", "str_", "(_", "x_", ")_", "for_", "x_", "in_", "pyv", "er", "\\u", "tuple_", "[_", ":_", "2_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "env_", "[_", "'", "PYTHON", "\\u", "VERSI", "ON", "'_", "]_", "=_", "pyv", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "PYTHON", "DIR", "'_", "in_", "conf_", "._", "environ_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "pyd", "ir_", "=_", "conf_", "._", "environ_", "[_", "'", "PYTHON", "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", "\t\t_", "if_", "sys_", "._", "platform_", "==_", "'", "win32", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "(_", "python", "\\u", "LIB", "DEST", "_", ",_", "pyd", "ir_", ")_", "=_", "\\u", "get", "\\u", "python", "\\u", "variables_", "(_", "python_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "get", "\\u", "config", "\\u", "var", "('", "LIB", "DEST", "')\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "get", "\\u", "python", "\\u", "lib", "(", "standard", "\\u", "lib", "=", "0", ",", " ", "prefix", "=", "%", "r", ")\"_", "%_", "conf_", "._", "env_", "[_", "'", "PREF", "IX", "'_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "from", " ", "distutils", ".", "sysconfig", " ", "import", " ", "get", "\\u", "config", "\\u", "var", ",", " ", "get", "\\u", "python", "\\u", "lib", "'_", "]_", ")_", "\\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_", "python", "\\u", "LIB", "DEST", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "pyd", "ir_", ",_", ")_", "=_", "\\u", "get", "\\u", "python", "\\u", "variables_", "(_", "python_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "\"", "get", "\\u", "python", "\\u", "lib", "(", "standard", "\\u", "lib", "=", "0", ",", " ", "prefix", "=", "%", "r", ")\"_", "%_", "conf_", "._", "env_", "[_", "'", "PREF", "IX", "'_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'", "from", " ", "distutils", ".", "sysconfig", " ", "import", " ", "get", "\\u", "config", "\\u", "var", ",", " ", "get", "\\u", "python", "\\u", "lib", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "python", "\\u", "LIB", "DEST", "_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t_", "if_", "conf_", "._", "env_", "[_", "'", "LIB", "DIR", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t\t\t_", "python", "\\u", "LIB", "DEST", "_", "=_", "os_", "._", "path_", "._", "join_", "(_", "conf_", "._", "env_", "[_", "'", "LIB", "DIR", "'_", "]_", ",_", "\"", "python", "\"_", "+_", "pyv", "er_", ")_", "\\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_", "python", "\\u", "LIB", "DEST", "_", "=_", "os_", "._", "path_", "._", "join_", "(_", "conf_", "._", "env_", "[_", "'", "PREF", "IX", "'_", "]_", ",_", "\"", "lib", "\"_", ",_", "\"", "python", "\"_", "+_", "pyv", "er_", ")_", "\\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_", "hasattr_", "(_", "conf_", ",_", "'", "defin", "e", "'_", ")_", ":_", "#", " ", "conf", ".", "defin", "e", " ", "is", " ", "adde", "d", " ", "by", " ", "the", " ", "C", " ", "tool", ",", " ", "so", " ", "may", " ", "not", " ", "exist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t\t_", "conf_", "._", "define_", "(_", "'", "PYTHON", "DIR", "'_", ",_", "pyd", "ir_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "conf_", "._", "env_", "[_", "'", "PYTHON", "DIR", "'_", "]_", "=_", "pyd", "ir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Feed", "back_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pyv", "er", "\\u", "full_", "=_", "'.'_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "pyv", "er", "\\u", "tuple_", "[_", ":_", "3_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "minv", "er_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "conf_", "._", "check", "\\u", "message", "\\u", "custom_", "(_", "'", "Pyth", "on", " ", "version", "'_", ",_", "''_", ",_", "pyv", "er", "\\u", "full_", ")_", "\\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_", "minv", "er", "\\u", "str_", "=_", "'.'_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "minv", "er_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conf_", "._", "check", "\\u", "message_", "(_", "'", "Pyth", "on", " ", "version", "'_", ",_", "\">", "=", " ", "%", "s", "\"_", "%_", "minv", "er", "\\u", "str_", ",_", "result_", ",_", "option_", "=_", "pyv", "er", "\\u", "full_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t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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 ]
Unused local variable
dimagi/commcare-hq/custom/_legacy/pact/api.py
[ { "content": " @method_decorator(httpdigest)\n @method_decorator(login_or_digest)\n def get(self, *args, **kwargs):\n \"\"\"\n Download prior progress note submissions for local access\n \"\"\"\n db = XFormInstance.get_db()\n couch_user = CouchUser.from_django_user(self.request.user)\n username = couch_user.raw_username\n if hasattr(localsettings, 'debug_pact_user'):\n username = getattr(localsettings, 'debug_pact_user')(username)\n\n offset =0\n limit_count=200\n total_count = 0\n\n query = {\n \"query\": {\n \"filtered\": {\n \"filter\": {\n \"and\": [\n {\"term\": {\"domain.exact\": \"pact\"}},\n {\"term\": {\"form.#type\": \"progress_note\"}},\n {\"term\": {\"form.meta.username\": username}}\n ]\n },\n \"query\": {\"match_all\": {}}\n }\n },\n \"sort\": {\"received_on\": \"asc\"},\n \"size\": limit_count,\n \"fields\": ['_id']\n }\n query['script_fields'] = {}\n query['script_fields'].update(pact_script_fields())\n query['script_fields'].update(case_script_field())\n\n res = self.xform_es.run_query(query)\n\n\n my_patients_ever_submitted_query = query_per_case_submissions_facet(PACT_DOMAIN, username)\n patients_res = self.xform_es.run_query(my_patients_ever_submitted_query)\n\n #filter by active/discharged?\n #get all the forms\n #get all the patients\n #get all patients to determine which to filter.\n\n active_patients = []\n for pt in []:\n #if pt.hp_status == \"Discharged\":\n #continue\n case_id = pt['script_case_id']\n active_patients.append(case_id)\n\n def return_iterator():\n yield \"<restoredata>\"\n for result in res['hits']['hits']:\n data_row = result['fields']\n\n# if data_row['script_case_id'] not in active_patients:\n# continue\n try:\n xml_str = db.fetch_attachment(data_row['_id'], 'form.xml').replace(\"<?xml version=\\'1.0\\' ?>\", '').replace(\"<?xml version='1.0' encoding='UTF-8' ?>\", '')\n yield xml_str\n except Exception, ex:\n logging.error(\"for downloader: error fetching attachment: %s\" % ex)\n yield \"</restoredata>\"\n\n response = HttpResponse(return_iterator(), content_type='text/xml')\n return response", "metadata": "root.PactFormAPI.get", "header": "['class', 'PactFormAPI', '(', 'DomainAPI', ')', ':', '___EOS___']", "index": 89 } ]
[ { "span": "offset ", "start_line": 101, "start_column": 8, "end_line": 101, "end_column": 14 }, { "span": "total_count ", "start_line": 103, "start_column": 8, "end_line": 103, "end_column": 19 }, { "span": "patients_res ", "start_line": 130, "start_column": 8, "end_line": 130, "end_column": 20 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Pac", "t", "Form", "API_", "(_", "Doma", "in", "API_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "http", "digest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "method", "\\u", "decorator_", "(_", "login", "\\u", "or", "\\u", "digest_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Down", "load", " ", "prior", " ", "progress", " ", "note", " ", "subm", "ission", "s", " ", "for", " ", "local", " ", "access", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "=_", "XF", "orm", "Instance_", "._", "get", "\\u", "db_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "couch", "\\u", "user_", "=_", "Cou", "ch", "User_", "._", "from", "\\u", "django", "\\u", "user_", "(_", "self_", "._", "request_", "._", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "username_", "=_", "couch", "\\u", "user_", "._", "raw", "\\u", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "locals", "ettings_", ",_", "'", "debug", "\\u", "pac", "t", "\\u", "user", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "username_", "=_", "getattr_", "(_", "locals", "ettings_", ",_", "'", "debug", "\\u", "pac", "t", "\\u", "user", "'_", ")_", "(_", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "offset_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "limit", "\\u", "count_", "=_", "200_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total", "\\u", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "query_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "query", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "filter", "ed", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "filter", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "and", "\"_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "term", "\"_", ":_", "{_", "\"", "domain", ".", "exact", "\"_", ":_", "\"", "pac", "t", "\"_", "}_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "term", "\"_", ":_", "{_", "\"", "form", ".#", "type", "\"_", ":_", "\"", "progress", "\\u", "note", "\"_", "}_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "term", "\"_", ":_", "{_", "\"", "form", ".", "meta", ".", "user", "name", "\"_", ":_", "username_", "}_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "query", "\"_", ":_", "{_", "\"", "match", "\\u", "all", "\"_", ":_", "{_", "}_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "sort", "\"_", ":_", "{_", "\"", "receive", "d\\u", "on", "\"_", ":_", "\"", "asc", "\"_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "size", "\"_", ":_", "limit", "\\u", "count_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "fields", "\"_", ":_", "[_", "'\\u", "id", "'_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "[_", "'", "script", "\\u", "fields", "'_", "]_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "[_", "'", "script", "\\u", "fields", "'_", "]_", "._", "update_", "(_", "pac", "t", "\\u", "script", "\\u", "fields_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "[_", "'", "script", "\\u", "fields", "'_", "]_", "._", "update_", "(_", "case", "\\u", "script", "\\u", "field_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "self_", "._", "xform", "\\u", "es_", "._", "run", "\\u", "query_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "my", "\\u", "patients", "\\u", "ever", "\\u", "submitted", "\\u", "query_", "=_", "query", "\\u", "per", "\\u", "case", "\\u", "subm", "ission", "s", "\\u", "facet_", "(_", "PAC", "T", "\\u", "DOMAIN_", ",_", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "patients", "\\u", "res_", "=_", "self_", "._", "xform", "\\u", "es_", "._", "run", "\\u", "query_", "(_", "my", "\\u", "patients", "\\u", "ever", "\\u", "submitted", "\\u", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "filter", " ", "by", " ", "active", "/", "discharge", "d", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "get", " ", "all", " ", "the", " ", "forms_", "\\u\\u\\uNL\\u\\u\\u_", "#", "get", " ", "all", " ", "the", " ", "patients", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "get", " ", "all", " ", "patients", " ", "to", " ", "dete", "rmin", "e", " ", "whi", "ch", " ", "to", " ", "filter", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "active", "\\u", "patients", "_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pt_", "in_", "[_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "pt", ".", "hp", "\\u", "status", " ", "==", " ", "\"", "Disc", "harg", "ed", "\":", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "case", "\\u", "id_", "=_", "pt_", "[_", "'", "script", "\\u", "case", "\\u", "id", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "active", "\\u", "patients", "_", "._", "append_", "(_", "case", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "return", "\\u", "iterator_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "\"<", "restore", "data", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "result_", "in_", "res_", "[_", "'", "hits", "'_", "]_", "[_", "'", "hits", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data\\u", "row_", "=_", "result_", "[_", "'", "fields", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "data\\u", "row", "['", "script", "\\u", "case", "\\u", "id", "']", " ", "not", " ", "in", " ", "active", "\\u", "patients", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "xml", "\\u", "str_", "=_", "db_", "._", "fetch", "\\u", "attachment_", "(_", "data\\u", "row_", "[_", "'\\u", "id", "'_", "]_", ",_", "'", "form", ".", "xml", "'_", ")_", "._", "replace_", "(_", "\"<", "?", "xml", " ", "version", "=\\\\", "'", "1.0", "\\\\'", " ", "?>", "\"_", ",_", "''_", ")_", "._", "replace_", "(_", "\"<", "?", "xml", " ", "version", "='", "1.0", "'", " ", "encoding", "='", "UT", "F", "-", "8", "'", " ", "?>", "\"_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "xml", "\\u", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", ",_", "ex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "logging_", "._", "error_", "(_", "\"", "for", " ", "downloader", ":", " ", "error", " ", "fetch", "ing", " ", "attach", "ment", ":", " ", "%", "s", "\"_", "%_", "ex_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "yield_", "\"<", "/", "restore", "data", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "response_", "=_", "Http", "Response_", "(_", "return", "\\u", "iterator_", "(_", ")_", ",_", "content", "\\u", "type_", "=_", "'", "text", "/", "xml", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "response_", "\\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, 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=True):\n \"\"\"Build a sparse matrix which can be used for performing...\n * convolution: in this case, the dot product of this matrix\n with the input images will generate a stack of images\n patches. Convolution is then a tensordot operation of the\n filters and the patch stack.\n * sparse local connections: in this case, the sparse matrix\n allows us to operate the weight matrix as if it were\n fully-connected. The structured-dot with the input image gives\n the output for the following layer.\n\n :param ker_shape: shape of kernel to apply (smaller than image)\n :param img_shape: shape of input images\n :param mode: 'valid' generates output only when kernel and\n image overlap overlap fully. Convolution obtained\n by zero-padding the input\n :param ws: True if weight sharing, false otherwise\n :param (dx,dy): offset parameter. In the case of no weight sharing,\n gives the pixel offset between two receptive fields.\n With weight sharing gives the offset between the\n top-left pixels of the generated patches\n\n :rtype: tuple(indices, indptr, logical_shape, sp_type, out_img_shp)\n :returns: the structure of a sparse matrix, and the logical dimensions\n of the image which will be the result of filtering.\n \"\"\"\n (dx, dy) = strides\n N = numpy\n\n # inshp contains either 2 entries (height,width) or 3 (nfeatures,h,w)\n # in the first case, default nfeatures to 1\n if N.size(inshp) == 2:\n inshp = (1,) + inshp\n\n inshp = N.array(inshp)\n kshp = N.array(kshp)\n ksize = N.prod(kshp)\n\n kern = ksize - 1 - N.arange(ksize)\n\n # size of output image if doing proper convolution\n # (mode='full',dx=dy=0) outshp is the actual output shape\n # given the parameters\n fulloutshp = inshp[1:] + kshp - 1\n if mode == 'valid':\n s = -1\n else:\n s = 1\n outshp = N.int64(N.ceil((inshp[1:] + s * kshp - s * 1) \\\n / N.array([dy, dx], dtype='float')))\n if any(outshp <= 0):\n err = 'Invalid kernel', kshp, 'and/or step size', (dx, dy),\\\n 'for given input shape', inshp\n raise ValueError(err)\n\n outsize = N.prod(outshp)\n insize = N.prod(inshp)\n\n # range of output units over which to iterate\n if mode == 'valid':\n lbound = N.array([kshp[0] - 1, kshp[1] - 1])\n ubound = lbound + (inshp[1:] - kshp + 1)\n else:\n lbound = N.zeros(2)\n ubound = fulloutshp\n\n # coordinates of image in \"fulloutshp\" coordinates\n topleft = N.array([kshp[0] - 1, kshp[1] - 1])\n # bound when counting the receptive field\n botright = topleft + inshp[1:]\n\n # sparse matrix specifics...\n if ws:\n spmatshp = (outsize * N.prod(kshp) * inshp[0], insize)\n else:\n spmatshp = (nkern * outsize, insize)\n spmat = scipy_sparse.lil_matrix(spmatshp)\n\n # loop over output image pixels\n z, zz = 0, 0\n\n # incremented every time we write something to the sparse\n # matrix this is used to track the ordering of filter tap\n # coefficient in sparse column ordering\n tapi, ntaps = 0, 0\n\n # Note: looping over the number of kernels could've been done\n # more efficiently as the last step (when writing to\n # spmat). However, this messes up the ordering of the column\n # values (order in which you write the values determines how\n # the vectorized data will get used later one)\n\n for fmapi in xrange(inshp[0]): # loop over input features\n # loop over number of kernels (nkern=1 for weight sharing)\n for n in xrange(nkern):\n\n # FOR EACH OUTPUT PIXEL...\n # loop over output image height\n for oy in N.arange(lbound[0], ubound[0], dy):\n # loop over output image width\n for ox in N.arange(lbound[1], ubound[1], dx):\n\n # kern[l] is filter value to apply at (oj,oi)\n # for (iy,ix)\n l = 0\n\n # ... ITERATE OVER INPUT UNITS IN RECEPTIVE FIELD\n for ky in oy + N.arange(kshp[0]):\n for kx in ox + N.arange(kshp[1]):\n\n # verify if we are still within image\n # boundaries. Equivalent to\n # zero-padding of the input image\n if (all((ky, kx) >= topleft) and\n all((ky, kx) < botright)):\n\n # convert to \"valid\" input space\n # coords used to determine column\n # index to write to in sparse mat\n iy, ix = N.array((ky, kx)) - topleft\n # determine raster-index of input pixel...\n\n # taking into account multiple\n # input features\n col = iy * inshp[2] + ix + \\\n fmapi * N.prod(inshp[1:])\n\n # convert oy,ox values to output\n # space coordinates\n if mode == 'full':\n (y, x) = (oy, ox)\n else:\n (y, x) = (oy, ox) - topleft\n # taking into account step size\n (y, x) = N.array([y, x]) / (dy, dx)\n\n # convert to row index of sparse matrix\n if ws:\n row = ((y * outshp[1] + x) *\n inshp[0] * ksize + l + fmapi *\n ksize)\n else:\n row = y * outshp[1] + x\n\n # Store something at that location\n # in sparse matrix. The written\n # value is only useful for the\n # sparse case. It will determine\n # the way kernel taps are mapped\n # onto the sparse columns (idea of\n # kernel map)\n # n*... only for sparse\n spmat[row + n * outsize, col] = tapi + 1\n\n # total number of active taps\n # (used for kmap)\n ntaps += 1\n\n # absolute tap index (total number of taps)\n tapi += 1\n # move on to next filter tap l=(l+1)%ksize\n l += 1\n\n if spmat.format != 'csc':\n spmat = spmat.tocsc().sorted_indices()\n else:\n # BUG ALERT: scipy0.6 has bug where data and indices are written in\n # reverse column ordering.\n # Explicit call to sorted_indices removes this problem.\n spmat = spmat.sorted_indices()\n\n if ws:\n kmap = None\n else:\n kmap = N.zeros(ntaps, dtype='int')\n k = 0\n # print 'TEMPORARY BUGFIX: REMOVE !!!'\n for j in xrange(spmat.shape[1]):\n for i_idx in xrange(spmat.indptr[j], spmat.indptr[j + 1]):\n if spmat.data[i_idx] != 0:\n # this is == spmat[i,j] - 1\n kmap[k] = spmat.data[i_idx] - 1\n k += 1\n\n # when in valid mode, it is more efficient to store in sparse row\n # TODO: need to implement structured dot for csr matrix\n assert spmat.format == 'csc'\n sptype = 'csc'\n #sptype = 'csr' if mode=='valid' else 'csc'\n if 0 and mode == 'valid':\n spmat = spmat.tocsr()\n\n rval = (spmat.indices[:spmat.size],\n spmat.indptr, spmatshp, sptype, outshp)\n if kmap is not None:\n rval += (kmap,)\n\n return rval", "metadata": "root.ConvolutionIndices.evaluate", "header": "['class', 'ConvolutionIndices', '(', 'Op', ')', ':', '___EOS___']", "index": 58 } ]
[ { "span": "kern ", "start_line": 97, "start_column": 8, "end_line": 97, "end_column": 12 }, { "span": "z,", "start_line": 138, "start_column": 8, "end_line": 138, "end_column": 9 }, { "span": "zz ", "start_line": 138, "start_column": 11, "end_line": 138, "end_column": 13 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Convolution", "Indices_", "(_", "Op_", ")_", ":_", "\\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_", "evaluate_", "(_", "ins", "hp_", ",_", "ksh", "p_", ",_", "strides_", "=_", "(_", "1_", ",_", "1_", ")_", ",_", "nke", "rn_", "=_", "1_", ",_", "mode_", "=_", "'", "valid", "'_", ",_", "ws_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Build", " ", "a", " ", "spars", "e", " ", "matrix", " ", "whi", "ch", " ", "can", " ", "be", " ", "used", " ", "for", " ", "perform", "ing", "...", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "convolution", ":", " ", "in", " ", "this", " ", "case", ",", " ", "the", " ", "dot", " ", "product", " ", "of", " ", "this", " ", "matrix", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "the", " ", "input", " ", "images", " ", "will", " ", "generat", "e", " ", "a", " ", "stack", " ", "of", " ", "images", "\\", "10", ";", " ", " ", " ", " ", "patche", "s", ".", " ", "Convolution", " ", "is", " ", "then", " ", "a", " ", "tensor", "dot", " ", "operati", "on", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "filter", "s", " ", "and", " ", "the", " ", "patch", " ", "stack", ".", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "spars", "e", " ", "local", " ", "connections", ":", " ", "in", " ", "this", " ", "case", ",", " ", "the", " ", "spars", "e", " ", "matrix", "\\", "10", ";", " ", " ", " ", " ", "allow", "s", " ", "us", " ", "to", " ", "operate", " ", "the", " ", "weight", " ", "matrix", " ", "as", " ", "if", " ", "it", " ", "wer", "e", "\\", "10", ";", " ", " ", " ", " ", "full", "y", "-", "connect", "ed", ".", " ", "The", " ", "structure", "d", "-", "dot", " ", "with", " ", "the", " ", "input", " ", "image", " ", "give", "s", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "output", " ", "for", " ", "the", " ", "follow", "ing", " ", "layer", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "ker", "\\u", "shape", ":", " ", "shape", " ", "of", " ", "kernel", " ", "to", " ", "appl", "y", " ", "(", "small", "er", " ", "than", " ", "image", ")", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "img", "\\u", "shape", ":", " ", "shape", " ", "of", " ", "input", " ", "images", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "mode", ":", " ", "'", "valid", "'", " ", "generat", "es", " ", "output", " ", "only", " ", "whe", "n", " ", "kernel", " ", "and", "\\", "10", ";", " ", " ", " ", "image", " ", "overl", "ap", " ", "overl", "ap", " ", "full", "y", ".", " ", "Convolution", " ", "obtain", "ed", "\\", "10", ";", " ", " ", " ", "by", " ", "zero", "-", "padd", "ing", " ", "the", " ", "input", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "ws", ":", " ", "Tru", "e", " ", "if", " ", "weight", " ", "shar", "ing", ",", " ", "fal", "se", " ", "other", "wis", "e", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "(", "dx", ",", "dy", "):", " ", "offset", " ", "parameter", ".", " ", "In", " ", "the", " ", "case", " ", "of", " ", "no", " ", "weight", " ", "shar", "ing", ",", "\\", "10", ";", " ", " ", "give", "s", " ", "the", " ", "pixel", " ", "offset", " ", "bet", "ween", " ", "two", " ", "recep", "tiv", "e", " ", "fields", ".", "\\", "10", ";", " ", " ", "With", " ", "weight", " ", "shar", "ing", " ", "give", "s", " ", "the", " ", "offset", " ", "bet", "ween", " ", "the", "\\", "10", ";", " ", " ", "top", "-", "left", " ", "pixel", "s", " ", "of", " ", "the", " ", "generat", "ed", " ", "patche", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", ":", "rty", "pe", ":", " ", "tuple", "(", "indice", "s", ",", " ", "indp", "tr", ",", " ", "logical", "\\u", "shape", ",", " ", "sp", "\\u", "type", ",", " ", "out", "\\u", "img", "\\u", "shp", ")", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "the", " ", "structure", " ", "of", " ", "a", " ", "spars", "e", " ", "matrix", ",", " ", "and", " ", "the", " ", "logical", " ", "dimension", "s", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "of", " ", "the", " ", "image", " ", "whi", "ch", " ", "will", " ", "be", " ", "the", " ", "result", " ", "of", " ", "filtering", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "dx_", ",_", "dy_", ")_", "=_", "strides_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "N_", "=_", "numpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ins", "hp", " ", "contain", "s", " ", "eit", "her", " ", "2", " ", "entri", "es", " ", "(", "height", ",", "widt", "h", ")", " ", "or", " ", "3", " ", "(", "nfe", "ature", "s", ",", "h", ",", "w", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "the", " ", "first", " ", "case", ",", " ", "default", " ", "nfe", "ature", "s", " ", "to", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "N_", "._", "size_", "(_", "ins", "hp_", ")_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ins", "hp_", "=_", "(_", "1_", ",_", ")_", "+_", "ins", "hp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ins", "hp_", "=_", "N_", "._", "array_", "(_", "ins", "hp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ksh", "p_", "=_", "N_", "._", "array_", "(_", "ksh", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ksize_", "=_", "N_", "._", "prod_", "(_", "ksh", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "kern", "_", "=_", "ksize_", "-_", "1_", "-_", "N_", "._", "arange_", "(_", "ksize_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "size", " ", "of", " ", "output", " ", "image", " ", "if", " ", "doi", "ng", " ", "proper", " ", "convolution", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "mode", "='", "full", "',", "dx", "=", "dy", "=", "0", ")", " ", "outs", "hp", " ", "is", " ", "the", " ", "actual", " ", "output", " ", "shape_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "give", "n", " ", "the", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "full", "outs", "hp_", "=_", "ins", "hp_", "[_", "1_", ":_", "]_", "+_", "ksh", "p_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mode_", "==_", "'", "valid", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "s_", "=_", "-_", "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 ", " _", "s_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "outs", "hp_", "=_", "N_", "._", "int64_", "(_", "N_", "._", "ceil_", "(_", "(_", "ins", "hp_", "[_", "1_", ":_", "]_", "+_", "s_", "*_", "ksh", "p_", "-_", "s_", "*_", "1_", ")_", "/_", "N_", "._", "array_", "(_", "[_", "dy_", ",_", "dx_", "]_", ",_", "dtype_", "=_", "'", "float", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "any_", "(_", "outs", "hp_", "<=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "err_", "=_", "'", "Inva", "lid", " ", "kernel", "'_", ",_", "ksh", "p_", ",_", "'", "and", "/", "or", " ", "step", " ", "size", "'_", ",_", "(_", "dx_", ",_", "dy_", ")_", ",_", "'", "for", " ", "give", "n", " ", "input", " ", "shape", "'_", ",_", "ins", "hp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Value", "Error_", "(_", "err_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "outsi", "ze_", "=_", "N_", "._", "prod_", "(_", "outs", "hp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "insi", "ze_", "=_", "N_", "._", "prod_", "(_", "ins", "hp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "range", " ", "of", " ", "output", " ", "unit", "s", " ", "over", " ", "whi", "ch", " ", "to", " ", "iterate_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "mode_", "==_", "'", "valid", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lbo", "und_", "=_", "N_", "._", "array_", "(_", "[_", "ksh", "p_", "[_", "0_", "]_", "-_", "1_", ",_", "ksh", "p_", "[_", "1_", "]_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ub", "ound_", "=_", "lbo", "und_", "+_", "(_", "ins", "hp_", "[_", "1_", ":_", "]_", "-_", "ksh", "p_", "+_", "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 ", " _", "lbo", "und_", "=_", "N_", "._", "zeros_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ub", "ound_", "=_", "full", "outs", "hp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "coordinate", "s", " ", "of", " ", "image", " ", "in", " ", "\"", "full", "outs", "hp", "\"", " ", "coordinates_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "topleft", "_", "=_", "N_", "._", "array_", "(_", "[_", "ksh", "p_", "[_", "0_", "]_", "-_", "1_", ",_", "ksh", "p_", "[_", "1_", "]_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "bound", " ", "whe", "n", " ", "counti", "ng", " ", "the", " ", "recep", "tiv", "e", " ", "field_", "\\u\\u\\uNL\\u\\u\\u_", "bot", "right_", "=_", "topleft", "_", "+_", "ins", "hp_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "spars", "e", " ", "matrix", " ", "specific", "s", "..._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ws_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spm", "ats", "hp_", "=_", "(_", "outsi", "ze_", "*_", "N_", "._", "prod_", "(_", "ksh", "p_", ")_", "*_", "ins", "hp_", "[_", "0_", "]_", ",_", "insi", "ze_", ")_", "\\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 ", " _", "spm", "ats", "hp_", "=_", "(_", "nke", "rn_", "*_", "outsi", "ze_", ",_", "insi", "ze_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "spm", "at_", "=_", "sci", "py", "\\u", "sparse_", "._", "lil", "\\u", "matrix_", "(_", "spm", "ats", "hp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "loop", " ", "over", " ", "output", " ", "image", " ", "pixels_", "\\u\\u\\uNL\\u\\u\\u_", "z_", ",_", "zz_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "increment", "ed", " ", "every", " ", "time", " ", "we", " ", "write", " ", "somet", "hing", " ", "to", " ", "the", " ", "sparse_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "matrix", " ", "this", " ", "is", " ", "used", " ", "to", " ", "track", " ", "the", " ", "orderi", "ng", " ", "of", " ", "filter", " ", "tap_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "coefficient", " ", "in", " ", "spars", "e", " ", "column", " ", "ordering_", "\\u\\u\\uNL\\u\\u\\u_", "tap", "i_", ",_", "nta", "ps_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "looping", " ", "over", " ", "the", " ", "number", " ", "of", " ", "kernels", " ", "coul", "d", "'", "ve", " ", "bee", "n", " ", "done_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "more", " ", "efficien", "tl", "y", " ", "as", " ", "the", " ", "last", " ", "step", " ", "(", "whe", "n", " ", "writ", "ing", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "spm", "at", ").", " ", "Ho", "we", "ver", ",", " ", "this", " ", "mess", "es", " ", "up", " ", "the", " ", "orderi", "ng", " ", "of", " ", "the", " ", "column_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "values", " ", "(", "order", " ", "in", " ", "whi", "ch", " ", "you", " ", "write", " ", "the", " ", "values", " ", "dete", "rmin", "es", " ", "how_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "vectorize", "d", " ", "data", " ", "will", " ", "get", " ", "used", " ", "late", "r", " ", "one", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "fma", "pi_", "in_", "xrange_", "(_", "ins", "hp_", "[_", "0_", "]_", ")_", ":_", "#", " ", "loop", " ", "over", " ", "input", " ", "features_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "loop", " ", "over", " ", "number", " ", "of", " ", "kernels", " ", "(", "nke", "rn", "=", "1", " ", "for", " ", "weight", " ", "shar", "ing", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "n_", "in_", "xrange_", "(_", "nke", "rn_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FOR", " ", "EAC", "H", " ", "OUTPU", "T", " ", "PIXEL", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "loop", " ", "over", " ", "output", " ", "image", " ", "height_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "oy", "_", "in_", "N_", "._", "arange_", "(_", "lbo", "und_", "[_", "0_", "]_", ",_", "ub", "ound_", "[_", "0_", "]_", ",_", "dy_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "loop", " ", "over", " ", "output", " ", "image", " ", "width_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "ox_", "in_", "N_", "._", "arange_", "(_", "lbo", "und_", "[_", "1_", "]_", ",_", "ub", "ound_", "[_", "1_", "]_", ",_", "dx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "kern", "[", "l", "]", " ", "is", " ", "filter", " ", "value", " ", "to", " ", "appl", "y", " ", "at", " ", "(", "oj", ",", "oi", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "(", "iy", ",", "ix", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "l_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "...", " ", "ITERA", "TE", " ", "OVER", " ", "INPUT", " ", "UNIT", "S", " ", "IN", " ", "REC", "EP", "TIVE", " ", "FIELD_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "ky_", "in_", "oy", "_", "+_", "N_", "._", "arange_", "(_", "ksh", "p_", "[_", "0_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "for_", "kx", "_", "in_", "ox_", "+_", "N_", "._", "arange_", "(_", "ksh", "p_", "[_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "verify", " ", "if", " ", "we", " ", "are", " ", "still", " ", "within", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bound", "aries", ".", " ", "Equivalent", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "zero", "-", "padd", "ing", " ", "of", " ", "the", " ", "input", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "(_", "all_", "(_", "(_", "ky_", ",_", "kx", "_", ")_", ">=_", "topleft", "_", ")_", "and_", "\\u\\u\\uNL\\u\\u\\u_", "all_", "(_", "(_", "ky_", ",_", "kx", "_", ")_", "<_", "bot", "right_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "convert", " ", "to", " ", "\"", "valid", "\"", " ", "input", " ", "space_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "coords", " ", "used", " ", "to", " ", "dete", "rmin", "e", " ", "column_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "index", " ", "to", " ", "write", " ", "to", " ", "in", " ", "spars", "e", " ", "mat_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "iy_", ",_", "ix_", "=_", "N_", "._", "array_", "(_", "(_", "ky_", ",_", "kx", "_", ")_", ")_", "-_", "topleft", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "dete", "rmin", "e", " ", "rast", "er", "-", "index", " ", "of", " ", "input", " ", "pixel", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "tak", "ing", " ", "int", "o", " ", "account", " ", "multiple_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "input", " ", "features_", "\\u\\u\\uNL\\u\\u\\u_", "col_", "=_", "iy_", "*_", "ins", "hp_", "[_", "2_", "]_", "+_", "ix_", "+_", "fma", "pi_", "*_", "N_", "._", "prod_", "(_", "ins", "hp_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "convert", " ", "oy", ",", "ox", " ", "values", " ", "to", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "space", " ", "coordinates_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "mode_", "==_", "'", "full", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "(_", "y_", ",_", "x_", ")_", "=_", "(_", "oy", "_", ",_", "ox_", ")_", "\\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 ", " ", " ", " _", "(_", "y_", ",_", "x_", ")_", "=_", "(_", "oy", "_", ",_", "ox_", ")_", "-_", "topleft", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "tak", "ing", " ", "int", "o", " ", "account", " ", "step", " ", "size_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "(_", "y_", ",_", "x_", ")_", "=_", "N_", "._", "array_", "(_", "[_", "y_", ",_", "x_", "]_", ")_", "/_", "(_", "dy_", ",_", "dx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "convert", " ", "to", " ", "row", " ", "index", " ", "of", " ", "spars", "e", " ", "matrix_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ws_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " ", " _", "row_", "=_", "(_", "(_", "y_", "*_", "outs", "hp_", "[_", "1_", "]_", "+_", "x_", ")_", "*_", "\\u\\u\\uNL\\u\\u\\u_", "ins", "hp_", "[_", "0_", "]_", "*_", "ksize_", "+_", "l_", "+_", "fma", "pi_", "*_", "\\u\\u\\uNL\\u\\u\\u_", "ksize_", ")_", "\\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 ", " ", " ", " _", "row_", "=_", "y_", "*_", "outs", "hp_", "[_", "1_", "]_", "+_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Stor", "e", " ", "somet", "hing", " ", "at", " ", "tha", "t", " ", "location_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "spars", "e", " ", "matrix", ".", " ", " ", "The", " ", "written_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "value", " ", "is", " ", "only", " ", "usef", "ul", " ", "for", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "spars", "e", " ", "case", ".", " ", "It", " ", "will", " ", "dete", "rmin", "e_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "way", " ", "kernel", " ", "taps", " ", "are", " ", "mapped_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "onto", " ", "the", " ", "spars", "e", " ", "column", "s", " ", "(", "idea", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "kernel", " ", "map", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "n", "*.", "..", " ", "only", " ", "for", " ", "sparse_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "spm", "at_", "[_", "row_", "+_", "n_", "*_", "outsi", "ze_", ",_", "col_", "]_", "=_", "tap", "i_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "total", " ", "number", " ", "of", " ", "active", " ", "taps", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "used", " ", "for", " ", "kma", "p", ")_", "\\u\\u\\uNL\\u\\u\\u_", "nta", "ps_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "abs", "olute", " ", "tap", " ", "index", " ", "(", "total", " ", "number", " ", "of", " ", "taps", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tap", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "move", " ", "on", " ", "to", " ", "next", " ", "filter", " ", "tap", " ", "l", "=(", "l", "+", "1", ")%", "ksize_", "\\u\\u\\uNL\\u\\u\\u_", "l_", "+=_", "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_", "\\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_", "spm", "at_", "._", "format_", "!=_", "'", "csc", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spm", "at_", "=_", "spm", "at_", "._", "toc", "sc_", "(_", ")_", "._", "sorte", "d\\u", "indices_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "BUG", " ", "ALERT", ":", " ", "sci", "py", "0.", "6", " ", "has", " ", "bug", " ", "where", " ", "data", " ", "and", " ", "indice", "s", " ", "are", " ", "writt", "en", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "reverse", " ", "column", " ", "orderi", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exp", "licit", " ", "call", " ", "to", " ", "sorte", "d\\u", "indice", "s", " ", "remove", "s", " ", "this", " ", "problem", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spm", "at_", "=_", "spm", "at_", "._", "sorte", "d\\u", "indices_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ws_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kma", "p_", "=_", "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 ", " _", "kma", "p_", "=_", "N_", "._", "zeros_", "(_", "nta", "ps_", ",_", "dtype_", "=_", "'", "int", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "'", "TEMP", "ORA", "RY", " ", "BUG", "FIX", ":", " ", "REMOVE", " ", "!!!", "'_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "j_", "in_", "xrange_", "(_", "spm", "at_", "._", "shape_", "[_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i", "\\u", "idx_", "in_", "xrange_", "(_", "spm", "at_", "._", "indp", "tr_", "[_", "j_", "]_", ",_", "spm", "at_", "._", "indp", "tr_", "[_", "j_", "+_", "1_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "spm", "at_", "._", "data_", "[_", "i", "\\u", "idx_", "]_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "is", " ", "==", " ", "spm", "at", "[", "i", ",", "j", "]", " ", "-", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "kma", "p_", "[_", "k_", "]_", "=_", "spm", "at_", "._", "data_", "[_", "i", "\\u", "idx_", "]_", "-_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whe", "n", " ", "in", " ", "valid", " ", "mode", ",", " ", "it", " ", "is", " ", "more", " ", "efficien", "t", " ", "to", " ", "store", " ", "in", " ", "spars", "e", " ", "row_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "need", " ", "to", " ", "implement", " ", "structure", "d", " ", "dot", " ", "for", " ", "csr", " ", "matrix_", "\\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_", "assert_", "spm", "at_", "._", "format_", "==_", "'", "csc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spt", "ype_", "=_", "'", "csc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "spt", "ype", " ", "=", " ", "'", "csr", "'", " ", "if", " ", "mode", "=='", "valid", "'", " ", "else", " ", "'", "csc", "'_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "0_", "and_", "mode_", "==_", "'", "valid", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "spm", "at_", "=_", "spm", "at_", "._", "toc", "sr_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rval_", "=_", "(_", "spm", "at_", "._", "indices_", "[_", ":_", "spm", "at_", "._", "size_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "spm", "at_", "._", "indp", "tr_", ",_", "spm", "ats", "hp_", ",_", "spt", "ype_", ",_", "outs", "hp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "kma", "p_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rval_", "+=_", "(_", "kma", "p_", ",_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "rval_", "\\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, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
aromanovich/kozmic-ci/tests/do_job_tests.py
[ { "content": " def test_private_project(self):\n cache_id = 'qwerty'\n cached_image = 'kozmic-cache/{}'.format(cache_id)\n\n try:\n for image_data in docker.images(cached_image):\n for repo_tag in image_data['RepoTags']:\n if repo_tag.startswith(cached_image):\n docker.remove_image(image_data['Id'])\n break\n except:\n pass\n assert not docker.images(cached_image)\n\n build = factories.BuildFactory.create(\n project=self.project,\n gh_commit_sha=self.prev_head_sha)\n hook_call = factories.HookCallFactory.create(\n hook=self.hook,\n build=build)\n\n job = self._do_job(hook_call)\n assert job.return_code == 0\n assert job.stdout == (\n 'Pulling \"{}\" Docker image...\\n'\n 'installed!\\nit works\\nYEAH\\n'.format(self.hook.docker_image))\n assert docker.images(cached_image)\n\n build = factories.BuildFactory.create(\n project=self.project,\n gh_commit_sha=self.head_sha)\n hook_call = factories.HookCallFactory.create(\n hook=self.hook,\n build=build)\n\n job = self._do_job(hook_call)\n assert job.return_code == 0\n assert job.stdout == (\n 'Pulling \"{}\" Docker image...\\n'\n 'Skipping install script as tracked files did not change...\\n'\n 'it works\\n'\n 'YEAH\\n'.format(self.hook.docker_image))", "metadata": "root.TestDoJob.test_private_project", "header": "['class', 'TestDoJob', '(', 'TestCase', ')', ':', '___EOS___']", "index": 61 } ]
[ { "span": "except:", "start_line": 71, "start_column": 8, "end_line": 71, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Test", "Do", "Job_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "private", "\\u", "project_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cache", "\\u", "id_", "=_", "'", "qwe", "rty", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cache", "d\\u", "image_", "=_", "'", "ko", "zm", "ic", "-", "cache", "/{}'_", "._", "format_", "(_", "cache", "\\u", "id_", ")_", "\\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 ", " _", "for_", "image", "\\u", "data_", "in_", "docker_", "._", "images_", "(_", "cache", "d\\u", "image_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "repo", "\\u", "tag_", "in_", "image", "\\u", "data_", "[_", "'", "Rep", "o", "Ta", "gs", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "repo", "\\u", "tag_", "._", "startswith_", "(_", "cache", "d\\u", "image_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "docker_", "._", "remove", "\\u", "image_", "(_", "image", "\\u", "data_", "[_", "'", "Id", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\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_", "assert_", "not_", "docker_", "._", "images_", "(_", "cache", "d\\u", "image_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "build_", "=_", "factories_", "._", "Build", "Factory_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "project_", "=_", "self_", "._", "project_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "gh", "\\u", "commit", "\\u", "sha_", "=_", "self_", "._", "prev", "\\u", "head", "\\u", "sha_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hook", "\\u", "call_", "=_", "factories_", "._", "Hook", "Call", "Factory_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "hook_", "=_", "self_", "._", "hook_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "build_", "=_", "build_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "job_", "=_", "self_", "._", "\\u", "do", "\\u", "job_", "(_", "hook", "\\u", "call_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "job_", "._", "return", "\\u", "code_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "job_", "._", "stdout_", "==_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Pul", "ling", " ", "\"{}\"", " ", "Docke", "r", " ", "image", "...", "\\\\", "n", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "install", "ed", "!\\\\", "nit", " ", "works", "\\\\", "n", "YEA", "H", "\\\\", "n", "'_", "._", "format_", "(_", "self_", "._", "hook_", "._", "docker", "\\u", "image_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "docker_", "._", "images_", "(_", "cache", "d\\u", "image_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "build_", "=_", "factories_", "._", "Build", "Factory_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "project_", "=_", "self_", "._", "project_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "gh", "\\u", "commit", "\\u", "sha_", "=_", "self_", "._", "head", "\\u", "sha_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hook", "\\u", "call_", "=_", "factories_", "._", "Hook", "Call", "Factory_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "hook_", "=_", "self_", "._", "hook_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "build_", "=_", "build_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "job_", "=_", "self_", "._", "\\u", "do", "\\u", "job_", "(_", "hook", "\\u", "call_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "job_", "._", "return", "\\u", "code_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "job_", "._", "stdout_", "==_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Pul", "ling", " ", "\"{}\"", " ", "Docke", "r", " ", "image", "...", "\\\\", "n", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Ski", "ppi", "ng", " ", "install", " ", "script", " ", "as", " ", "tracked", " ", "files", " ", "did", " ", "not", " ", "change", "...", "\\\\", "n", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "it", " ", "works", "\\\\", "n", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "YEA", "H", "\\\\", "n", "'_", "._", "format_", "(_", "self_", "._", "hook_", "._", "docker", "\\u", "image_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
dgraziotin/dycapo/tests/test_multiple_matching.py
[ { "content": "\"\"\"\n Copyright 2010 Daniel Graziotin <daniel.graziotin@acm.org>\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\"\"\"\nimport classes\nimport utils\nimport copy\nimport settings\nimport response_codes\nimport py\n \n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestMultipleMatching():\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.TestMultipleMatching", "header": "['module', '___EOS___']", "index": 21 }, { "content": " def setup_class(self):\n self.driver = classes.Driver(settings.DRIVER_USERNAME,settings.DRIVER_PASSWORD,settings.DYCAPO_URL)\n\n self.rider1 = classes.Rider(\"rob\",settings.RIDER_PASSWORD,settings.DYCAPO_URL)\n self.rider2 = classes.Rider(\"dio\",settings.RIDER_PASSWORD,settings.DYCAPO_URL)\n self.rider3 = classes.Rider(\"angela\",settings.RIDER_PASSWORD,settings.DYCAPO_URL)\n self.rider4 = classes.Rider(\"ozzy\",settings.RIDER_PASSWORD,settings.DYCAPO_URL)\n self.riders = [self.rider1, self.rider2, self.rider3, self.rider4]\n self.rider5 = classes.Rider(settings.RIDER_USERNAME,settings.RIDER_PASSWORD,settings.DYCAPO_URL)\n self.rider6 = classes.Rider(\"bruce\",settings.RIDER_PASSWORD,settings.DYCAPO_URL)\n\n self.driver_position = '46.490200 11.342294'\n self.driver_destination = '46.500740 11.345073'\n self.rider_position = '46.494957 11.340239'\n self.rider_destination = '46.500891 11.344306'", "metadata": "root.TestMultipleMatching.setup_class", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 22 }, { "content": " def teardown_class(self):\n if settings.FINISH_TRIP_AFTER_TESTS:\n self.driver.finish_trip(self.driver.trip)", "metadata": "root.TestMultipleMatching.teardown_class", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 38 }, { "content": " def setup_method(self,method):\n self.driver.location = classes.Location(georss_point=self.driver_position)\n self.driver.destination = classes.Location(georss_point=self.driver_destination,point='dest')\n self.rider5.location = classes.Location(georss_point=self.rider_position)\n self.rider5.destination = classes.Location(georss_point=self.rider_destination,point='dest')\n self.rider6.location = classes.Location(georss_point=self.rider_position)\n self.rider6.destination = classes.Location(georss_point=self.rider_destination,point='dest')\n\n for rider in self.riders:\n rider.location = classes.Location(georss_point=self.rider_position)\n rider.destination = classes.Location(georss_point=self.rider_destination,point='dest')", "metadata": "root.TestMultipleMatching.setup_method", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 43 }, { "content": " def test_position(self):\n response = self.driver.update_position()\n assert response['code'] == response_codes.CREATED or response['code'] == response_codes.ALL_OK\n response = self.driver.get_position()\n assert response['value']['georss_point'] == self.driver.location.georss_point\n self.driver.location = response['value']\n\n response = self.rider5.update_position()\n assert response['code'] == response_codes.CREATED or response['code'] == response_codes.ALL_OK\n response = self.rider5.get_position()\n assert response['value']['georss_point'] == self.rider5.location.georss_point\n self.rider5.location = response['value']\n\n\n response = self.rider6.update_position(location=self.rider6.location)\n assert response['code'] == response_codes.CREATED or response['code'] == response_codes.ALL_OK\n response = self.rider6.get_position()\n assert response['value']['georss_point'] == self.rider6.location.georss_point\n self.rider6.location = response['value']\n\n\n for rider in self.riders:\n response = rider.update_position()\n assert response['code'] == response_codes.CREATED or response['code'] == response_codes.ALL_OK\n response = rider.get_position()\n assert response['value']['georss_point'] == rider.location.georss_point\n rider.location = response['value']", "metadata": "root.TestMultipleMatching.test_position", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 55 }, { "content": " def test_insert_trip_exp(self):\n response = self.driver.insert_trip_exp()\n assert response['value']['id'] > 0\n assert [location for location in response['value']['locations'] if location['point']=='dest'][0]['georss_point'] == self.driver_destination\n assert response['code']==response_codes.ALL_OK\n self.driver.trip = response['value']", "metadata": "root.TestMultipleMatching.test_insert_trip_exp", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 83 }, { "content": " def test_search_trip_before_start(self):\n for rider in self.riders:\n response = rider.search_ride(rider.location,rider.destination)\n assert response['code'] == response_codes.ALL_OK\n with py.test.raises(KeyError):\n assert response['trips'] == True", "metadata": "root.TestMultipleMatching.test_search_trip_before_start", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 90 }, { "content": " def test_start_trip(self):\n response = self.driver.start_trip()\n assert response['code'] == response_codes.ALL_OK", "metadata": "root.TestMultipleMatching.test_start_trip", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 97 }, { "content": " def test_search_trip_after_start(self):\n for rider in self.riders:\n response = rider.search_ride(rider.location,rider.destination)\n assert response['code'] == response_codes.ALL_OK\n rider.trip = response['value']['trips'][0]", "metadata": "root.TestMultipleMatching.test_search_trip_after_start", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 102 }, { "content": " def test_search_trip_driver_closest_to_destination(self):\n driver_position = '46.500730 11.345070'\n self.driver.location = classes.Location(georss_point=driver_position,point='posi')\n self.driver.update_position()\n\n response = self.rider1.search_ride(self.rider1.location,self.rider1.destination)\n assert response['code'] == response_codes.ALL_OK\n with py.test.raises(KeyError):\n assert response['trips'] == True\n self.driver.location = classes.Location(georss_point=self.driver_position)\n self.driver.update_position()", "metadata": "root.TestMultipleMatching.test_search_trip_driver_closest_to_destination", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 108 }, { "content": " def test_check_ride_requests_before_request(self):\n response = self.driver.check_ride_requests()\n assert len(response['value']) == 0", "metadata": "root.TestMultipleMatching.test_check_ride_requests_before_request", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 120 }, { "content": " def test_get_position_before_request(self):\n for rider in self.riders:\n response = self.driver.get_position(person=rider)\n print rider.username\n assert response['code'] == response_codes.FORBIDDEN", "metadata": "root.TestMultipleMatching.test_get_position_before_request", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 124 }, { "content": " def test_request_ride(self):\n for rider in self.riders:\n response = rider.request_ride(trip=rider.trip)\n assert response['code'] == response_codes.CREATED or response['code'] == response_codes.ALL_OK", "metadata": "root.TestMultipleMatching.test_request_ride", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 130 }, { "content": " def test_check_ride_requests_after_request(self):\n for rider in self.riders:\n response = self.driver.check_ride_requests()\n assert response['code'] == response_codes.ALL_OK\n self.driver.ride_request = response['value']", "metadata": "root.TestMultipleMatching.test_check_ride_requests_after_request", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 135 }, { "content": " def test_accept_ride_request(self):\n for rider in self.driver.ride_request:\n response = self.driver.accept_ride_request(rider)\n assert response['code'] == response_codes.ALL_OK", "metadata": "root.TestMultipleMatching.test_accept_ride_request", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 141 }, { "content": " def test_get_position_after_request(self):\n for rider in self.riders:\n response = self.driver.get_position(person=rider)\n assert response['code'] == response_codes.ALL_OK", "metadata": "root.TestMultipleMatching.test_get_position_after_request", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 146 }, { "content": " def test_start_ride(self):\n for rider in self.riders:\n if not hasattr(rider,\"trip\"):\n break\n response = rider.start_ride(rider.trip)\n assert response['code'] == response_codes.ALL_OK", "metadata": "root.TestMultipleMatching.test_start_ride", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 151 }, { "content": " def test_search_trip_no_vacany(self):\n response = self.rider5.search_ride(self.rider5.location,self.rider5.destination)\n assert response['code'] == response_codes.ALL_OK\n with py.test.raises(KeyError):\n assert response['trips'] == True", "metadata": "root.TestMultipleMatching.test_search_trip_no_vacany", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 158 }, { "content": " def test_search_trip_vacany(self):\n response = self.rider4.finish_ride(self.rider4.trip)\n assert response['code'] == response_codes.ALL_OK\n\n response = self.rider5.search_ride(self.rider5.location,self.rider5.destination)\n assert response['code'] == response_codes.ALL_OK\n\n self.rider5.trip = response['value']['trips'][0]", "metadata": "root.TestMultipleMatching.test_search_trip_vacany", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 164 }, { "content": " def test_request_ride_rider5(self):\n response = self.rider5.request_ride(trip=self.rider5.trip)\n assert response['code'] == response_codes.CREATED or response['code'] == response_codes.ALL_OK", "metadata": "root.TestMultipleMatching.test_request_ride_rider5", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 173 }, { "content": " def test_check_ride_request_rider5(self):\n response = self.driver.check_ride_requests()\n assert response['code'] == response_codes.ALL_OK\n participation = utils.get_requested_participation(response['value'])\n assert participation['author']['username'] == self.rider5.username\n self.driver.ride_request = response['value']", "metadata": "root.TestMultipleMatching.test_check_ride_request_rider5", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 178 }, { "content": " def test_cancel_requested_ride(self):\n response = self.rider5.cancel_requested_ride(trip=self.rider5.trip)\n assert response['code'] == response_codes.DELETED", "metadata": "root.TestMultipleMatching.test_cancel_requested_ride", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 186 }, { "content": " def test_check_cancelled_ride_request_rider5(self):\n response = self.driver.check_ride_requests()\n assert response['code'] == response_codes.ALL_OK\n participation = utils.get_requested_participation(response['value'])\n assert not participation", "metadata": "root.TestMultipleMatching.test_check_cancelled_ride_request_rider5", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 190 }, { "content": " def test_get_position_cancelled_ride_request(self):\n response = self.driver.get_position(self.rider5)\n assert response['code'] == response_codes.FORBIDDEN", "metadata": "root.TestMultipleMatching.test_get_position_cancelled_ride_request", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 196 }, { "content": " def test_search_trip_rider6(self):\n response = self.rider6.search_ride(self.rider6.location,self.rider6.destination)\n assert response['code'] == response_codes.ALL_OK\n self.rider6.trip = response['value']['trips'][0]", "metadata": "root.TestMultipleMatching.test_search_trip_rider6", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 201 }, { "content": " def test_request_ride_rider6(self):\n response = self.rider6.request_ride(trip=self.rider6.trip)\n assert response['code'] == response_codes.CREATED or response['code'] == response_codes.ALL_OK", "metadata": "root.TestMultipleMatching.test_request_ride_rider6", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 206 }, { "content": " def test_check_ride_request_rider5(self):\n response = self.driver.check_ride_requests()\n assert response['code'] == response_codes.ALL_OK\n participation = utils.get_requested_participation(response['value'])\n assert participation['author']['username'] == self.rider6.username\n self.driver.ride_request = response['value']", "metadata": "root.TestMultipleMatching.test_check_ride_request_rider5", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 210 }, { "content": " def test_finish_ride(self):\n for rider in self.riders:\n if not hasattr(rider,\"trip\"):\n break\n response = rider.finish_ride(rider.trip)\n assert response['code'] == response_codes.ALL_OK", "metadata": "root.TestMultipleMatching.test_finish_ride", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 217 }, { "content": " def test_get_position_after_ride_finished(self):\n for rider in self.riders:\n response = self.driver.get_position(person=rider)\n assert response['code'] == response_codes.FORBIDDEN", "metadata": "root.TestMultipleMatching.test_get_position_after_ride_finished", "header": "['class', 'TestMultipleMatching', '(', ')', ':', '___EOS___']", "index": 224 } ]
[ { "span": "import copy", "start_line": 17, "start_column": 0, "end_line": 17, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", " ", " ", " ", "Copy", "right", " ", "2010", " ", "Dan", "iel", " ", "Gra", "zi", "oti", "n", " ", "<", "dan", "iel", ".", "gra", "zi", "oti", "n", "@", "acm", ".", "org", ">", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", "License", "d", " ", "under", " ", "the", " ", "Ap", "ache", " ", "License", ",", " ", "Version", " ", "2.0", " ", "(", "the", " ", "\"", "License", "\");", "\\", "10", ";", " ", " ", " ", "you", " ", "may", " ", "not", " ", "use", " ", "this", " ", "file", " ", "except", " ", "in", " ", "compli", "anc", "e", " ", "with", " ", "the", " ", "License", ".", "\\", "10", ";", " ", " ", " ", "You", " ", "may", " ", "obtain", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "License", " ", "at", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", "http", "://", "www", ".", "apa", "che", ".", "org", "/", "license", "s", "/", "LICENSE", "-", "2.0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", "Un", "less", " ", "require", "d", " ", "by", " ", "applica", "ble", " ", "law", " ", "or", " ", "agree", "d", " ", "to", " ", "in", " ", "writ", "ing", ",", " ", "software", "\\", "10", ";", " ", " ", " ", "distributed", " ", "under", " ", "the", " ", "License", " ", "is", " ", "distributed", " ", "on", " ", "an", " ", "\"", "AS", " ", "IS", "\"", " ", "BAS", "IS", ",", "\\", "10", ";", " ", " ", " ", "WITH", "OUT", " ", "WAR", "RAN", "TIES", " ", "OR", " ", "CONDITION", "S", " ", "OF", " ", "ANY", " ", "KIND", ",", " ", "eit", "her", " ", "express", " ", "or", " ", "impli", "ed", ".", "\\", "10", ";", " ", " ", " ", "See", " ", "the", " ", "License", " ", "for", " ", "the", " ", "specific", " ", "language", " ", "govern", "ing", " ", "permissi", "ons", " ", "and", "\\", "10", ";", " ", " ", " ", "limit", "ation", "s", " ", "under", " ", "the", " ", "License", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "classes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "response", "\\u", "codes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "py_", "\\u\\u\\uNEWLINE\\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\\uNEWLINE\\u\\u\\u_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\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\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\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "setup", "\\u", "class_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "driver_", "=_", "classes_", "._", "Driver_", "(_", "settings_", "._", "DRIVER", "\\u", "USERNAME_", ",_", "settings_", "._", "DRIVER", "\\u", "PASSWORD_", ",_", "settings_", "._", "DY", "CAP", "O", "\\u", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ride", "r1_", "=_", "classes_", "._", "Rid", "er_", "(_", "\"", "rob", "\"_", ",_", "settings_", "._", "RID", "ER", "\\u", "PASSWORD_", ",_", "settings_", "._", "DY", "CAP", "O", "\\u", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ride", "r2_", "=_", "classes_", "._", "Rid", "er_", "(_", "\"", "dio", "\"_", ",_", "settings_", "._", "RID", "ER", "\\u", "PASSWORD_", ",_", "settings_", "._", "DY", "CAP", "O", "\\u", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ride", "r3_", "=_", "classes_", "._", "Rid", "er_", "(_", "\"", "ange", "la", "\"_", ",_", "settings_", "._", "RID", "ER", "\\u", "PASSWORD_", ",_", "settings_", "._", "DY", "CAP", "O", "\\u", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ride", "r4", "_", "=_", "classes_", "._", "Rid", "er_", "(_", "\"", "oz", "zy", "\"_", ",_", "settings_", "._", "RID", "ER", "\\u", "PASSWORD_", ",_", "settings_", "._", "DY", "CAP", "O", "\\u", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ride", "rs_", "=_", "[_", "self_", "._", "ride", "r1_", ",_", "self_", "._", "ride", "r2_", ",_", "self_", "._", "ride", "r3_", ",_", "self_", "._", "ride", "r4", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ride", "r", "5_", "=_", "classes_", "._", "Rid", "er_", "(_", "settings_", "._", "RID", "ER", "\\u", "USERNAME_", ",_", "settings_", "._", "RID", "ER", "\\u", "PASSWORD_", ",_", "settings_", "._", "DY", "CAP", "O", "\\u", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ride", "r", "6_", "=_", "classes_", "._", "Rid", "er_", "(_", "\"", "bru", "ce", "\"_", ",_", "settings_", "._", "RID", "ER", "\\u", "PASSWORD_", ",_", "settings_", "._", "DY", "CAP", "O", "\\u", "URL_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "driver", "\\u", "position_", "=_", "'", "46.", "490", "200", " ", "11.", "342", "294", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver", "\\u", "destination_", "=_", "'", "46.", "500", "740", " ", "11.", "345", "073", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ride", "r", "\\u", "position_", "=_", "'", "46.", "494", "957", " ", " ", "11.", "340", "239", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ride", "r", "\\u", "destination_", "=_", "'", "46.", "500", "891", " ", " ", "11.", "344", "306", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "tear", "down", "\\u", "class_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "settings_", "._", "FINISH", "\\u", "TRI", "P", "\\u", "AFTER", "\\u", "TESTS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "driver_", "._", "finish", "\\u", "trip_", "(_", "self_", "._", "driver_", "._", "trip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\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_", "setup", "\\u", "method_", "(_", "self_", ",_", "method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "driver_", "._", "location_", "=_", "classes_", "._", "Location_", "(_", "geor", "ss", "\\u", "point_", "=_", "self_", "._", "driver", "\\u", "position_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver_", "._", "destination_", "=_", "classes_", "._", "Location_", "(_", "geor", "ss", "\\u", "point_", "=_", "self_", "._", "driver", "\\u", "destination_", ",_", "point_", "=_", "'", "dest", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ride", "r", "5_", "._", "location_", "=_", "classes_", "._", "Location_", "(_", "geor", "ss", "\\u", "point_", "=_", "self_", "._", "ride", "r", "\\u", "position_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ride", "r", "5_", "._", "destination_", "=_", "classes_", "._", "Location_", "(_", "geor", "ss", "\\u", "point_", "=_", "self_", "._", "ride", "r", "\\u", "destination_", ",_", "point_", "=_", "'", "dest", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ride", "r", "6_", "._", "location_", "=_", "classes_", "._", "Location_", "(_", "geor", "ss", "\\u", "point_", "=_", "self_", "._", "ride", "r", "\\u", "position_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ride", "r", "6_", "._", "destination_", "=_", "classes_", "._", "Location_", "(_", "geor", "ss", "\\u", "point_", "=_", "self_", "._", "ride", "r", "\\u", "destination_", ",_", "point_", "=_", "'", "dest", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "ride", "r_", "in_", "self_", "._", "ride", "rs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ride", "r_", "._", "location_", "=_", "classes_", "._", "Location_", "(_", "geor", "ss", "\\u", "point_", "=_", "self_", "._", "ride", "r", "\\u", "position_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ride", "r_", "._", "destination_", "=_", "classes_", "._", "Location_", "(_", "geor", "ss", "\\u", "point_", "=_", "self_", "._", "ride", "r", "\\u", "destination_", ",_", "point_", "=_", "'", "dest", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\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", "position_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "driver_", "._", "update", "\\u", "position_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "CREATED_", "or_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "driver_", "._", "get", "\\u", "position_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "value", "'_", "]_", "[_", "'", "geor", "ss", "\\u", "point", "'_", "]_", "==_", "self_", "._", "driver_", "._", "location_", "._", "geor", "ss", "\\u", "point_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver_", "._", "location_", "=_", "response_", "[_", "'", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "ride", "r", "5_", "._", "update", "\\u", "position_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "CREATED_", "or_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "ride", "r", "5_", "._", "get", "\\u", "position_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "value", "'_", "]_", "[_", "'", "geor", "ss", "\\u", "point", "'_", "]_", "==_", "self_", "._", "ride", "r", "5_", "._", "location_", "._", "geor", "ss", "\\u", "point_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ride", "r", "5_", "._", "location_", "=_", "response_", "[_", "'", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "ride", "r", "6_", "._", "update", "\\u", "position_", "(_", "location_", "=_", "self_", "._", "ride", "r", "6_", "._", "location_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "CREATED_", "or_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "self_", "._", "ride", "r", "6_", "._", "get", "\\u", "position_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "value", "'_", "]_", "[_", "'", "geor", "ss", "\\u", "point", "'_", "]_", "==_", "self_", "._", "ride", "r", "6_", "._", "location_", "._", "geor", "ss", "\\u", "point_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ride", "r", "6_", "._", "location_", "=_", "response_", "[_", "'", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "ride", "r_", "in_", "self_", "._", "ride", "rs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "ride", "r_", "._", "update", "\\u", "position_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "CREATED_", "or_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "ride", "r_", "._", "get", "\\u", "position_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "value", "'_", "]_", "[_", "'", "geor", "ss", "\\u", "point", "'_", "]_", "==_", "ride", "r_", "._", "location_", "._", "geor", "ss", "\\u", "point_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ride", "r_", "._", "location_", "=_", "response_", "[_", "'", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\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", "insert", "\\u", "trip", "\\u", "exp_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "driver_", "._", "insert", "\\u", "trip", "\\u", "exp_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "value", "'_", "]_", "[_", "'", "id", "'_", "]_", ">_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "[_", "location_", "for_", "location_", "in_", "response_", "[_", "'", "value", "'_", "]_", "[_", "'", "location", "s", "'_", "]_", "if_", "location_", "[_", "'", "point", "'_", "]_", "==_", "'", "dest", "'_", "]_", "[_", "0_", "]_", "[_", "'", "geor", "ss", "\\u", "point", "'_", "]_", "==_", "self_", "._", "driver", "\\u", "destination_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver_", "._", "trip_", "=_", "response_", "[_", "'", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "search", "\\u", "trip", "\\u", "bef", "ore", "\\u", "start_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ride", "r_", "in_", "self_", "._", "ride", "rs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "ride", "r_", "._", "search", "\\u", "ride", "_", "(_", "ride", "r_", "._", "location_", ",_", "ride", "r_", "._", "destination_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "py_", "._", "test_", "._", "raises_", "(_", "Key", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "response_", "[_", "'", "trips", "'_", "]_", "==_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\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", "start", "\\u", "trip_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "driver_", "._", "start", "\\u", "trip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "search", "\\u", "trip", "\\u", "after", "\\u", "start_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ride", "r_", "in_", "self_", "._", "ride", "rs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "ride", "r_", "._", "search", "\\u", "ride", "_", "(_", "ride", "r_", "._", "location_", ",_", "ride", "r_", "._", "destination_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ride", "r_", "._", "trip_", "=_", "response_", "[_", "'", "value", "'_", "]_", "[_", "'", "trips", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\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", "search", "\\u", "trip", "\\u", "driver", "\\u", "closest", "\\u", "to", "\\u", "destination_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "driver", "\\u", "position_", "=_", "'", "46.", "500", "730", " ", "11.", "345", "070", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver_", "._", "location_", "=_", "classes_", "._", "Location_", "(_", "geor", "ss", "\\u", "point_", "=_", "driver", "\\u", "position_", ",_", "point_", "=_", "'", "posi", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver_", "._", "update", "\\u", "position_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "ride", "r1_", "._", "search", "\\u", "ride", "_", "(_", "self_", "._", "ride", "r1_", "._", "location_", ",_", "self_", "._", "ride", "r1_", "._", "destination_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "py_", "._", "test_", "._", "raises_", "(_", "Key", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "response_", "[_", "'", "trips", "'_", "]_", "==_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "driver_", "._", "location_", "=_", "classes_", "._", "Location_", "(_", "geor", "ss", "\\u", "point_", "=_", "self_", "._", "driver", "\\u", "position_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver_", "._", "update", "\\u", "position_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "check", "\\u", "ride", "\\u", "request", "s", "\\u", "bef", "ore", "\\u", "request_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "driver_", "._", "check", "\\u", "ride", "\\u", "requests_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "len_", "(_", "response_", "[_", "'", "value", "'_", "]_", ")_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "position", "\\u", "bef", "ore", "\\u", "request_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ride", "r_", "in_", "self_", "._", "ride", "rs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "driver_", "._", "get", "\\u", "position_", "(_", "person_", "=_", "ride", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "ride", "r_", "._", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "FORB", "IDD", "EN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\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", "request", "\\u", "ride", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ride", "r_", "in_", "self_", "._", "ride", "rs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "ride", "r_", "._", "request", "\\u", "ride", "_", "(_", "trip_", "=_", "ride", "r_", "._", "trip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "CREATED_", "or_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\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", "check", "\\u", "ride", "\\u", "request", "s", "\\u", "after", "\\u", "request_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ride", "r_", "in_", "self_", "._", "ride", "rs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "driver_", "._", "check", "\\u", "ride", "\\u", "requests_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver_", "._", "ride", "\\u", "request_", "=_", "response_", "[_", "'", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\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", "accept", "\\u", "ride", "\\u", "request_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ride", "r_", "in_", "self_", "._", "driver_", "._", "ride", "\\u", "request_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "driver_", "._", "accept", "\\u", "ride", "\\u", "request_", "(_", "ride", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\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", "get", "\\u", "position", "\\u", "after", "\\u", "request_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ride", "r_", "in_", "self_", "._", "ride", "rs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "driver_", "._", "get", "\\u", "position_", "(_", "person_", "=_", "ride", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\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", "start", "\\u", "ride", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ride", "r_", "in_", "self_", "._", "ride", "rs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "hasattr_", "(_", "ride", "r_", ",_", "\"", "trip", "\"_", ")_", ":_", "\\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_", "response_", "=_", "ride", "r_", "._", "start", "\\u", "ride", "_", "(_", "ride", "r_", "._", "trip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\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", "search", "\\u", "trip", "\\u", "no", "\\u", "vaca", "ny_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "ride", "r", "5_", "._", "search", "\\u", "ride", "_", "(_", "self_", "._", "ride", "r", "5_", "._", "location_", ",_", "self_", "._", "ride", "r", "5_", "._", "destination_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "py_", "._", "test_", "._", "raises_", "(_", "Key", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "response_", "[_", "'", "trips", "'_", "]_", "==_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\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", "search", "\\u", "trip", "\\u", "vaca", "ny_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "ride", "r4", "_", "._", "finish", "\\u", "ride", "_", "(_", "self_", "._", "ride", "r4", "_", "._", "trip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "self_", "._", "ride", "r", "5_", "._", "search", "\\u", "ride", "_", "(_", "self_", "._", "ride", "r", "5_", "._", "location_", ",_", "self_", "._", "ride", "r", "5_", "._", "destination_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "ride", "r", "5_", "._", "trip_", "=_", "response_", "[_", "'", "value", "'_", "]_", "[_", "'", "trips", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "request", "\\u", "ride", "\\u", "ride", "r", "5_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "ride", "r", "5_", "._", "request", "\\u", "ride", "_", "(_", "trip_", "=_", "self_", "._", "ride", "r", "5_", "._", "trip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "CREATED_", "or_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "check", "\\u", "ride", "\\u", "request", "\\u", "ride", "r", "5_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "driver_", "._", "check", "\\u", "ride", "\\u", "requests_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "participati", "on_", "=_", "utils_", "._", "get", "\\u", "request", "ed", "\\u", "participati", "on_", "(_", "response_", "[_", "'", "value", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "participati", "on_", "[_", "'", "author", "'_", "]_", "[_", "'", "user", "name", "'_", "]_", "==_", "self_", "._", "ride", "r", "5_", "._", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver_", "._", "ride", "\\u", "request_", "=_", "response_", "[_", "'", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "cancel", "\\u", "request", "ed", "\\u", "ride", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "ride", "r", "5_", "._", "cancel", "\\u", "request", "ed", "\\u", "ride", "_", "(_", "trip_", "=_", "self_", "._", "ride", "r", "5_", "._", "trip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "DELETED", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "check", "\\u", "cancel", "led", "\\u", "ride", "\\u", "request", "\\u", "ride", "r", "5_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "driver_", "._", "check", "\\u", "ride", "\\u", "requests_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "participati", "on_", "=_", "utils_", "._", "get", "\\u", "request", "ed", "\\u", "participati", "on_", "(_", "response_", "[_", "'", "value", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "participati", "on_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "position", "\\u", "cancel", "led", "\\u", "ride", "\\u", "request_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "driver_", "._", "get", "\\u", "position_", "(_", "self_", "._", "ride", "r", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "FORB", "IDD", "EN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "search", "\\u", "trip", "\\u", "ride", "r", "6_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "ride", "r", "6_", "._", "search", "\\u", "ride", "_", "(_", "self_", "._", "ride", "r", "6_", "._", "location_", ",_", "self_", "._", "ride", "r", "6_", "._", "destination_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ride", "r", "6_", "._", "trip_", "=_", "response_", "[_", "'", "value", "'_", "]_", "[_", "'", "trips", "'_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "request", "\\u", "ride", "\\u", "ride", "r", "6_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "ride", "r", "6_", "._", "request", "\\u", "ride", "_", "(_", "trip_", "=_", "self_", "._", "ride", "r", "6_", "._", "trip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "CREATED_", "or_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "check", "\\u", "ride", "\\u", "request", "\\u", "ride", "r", "5_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "driver_", "._", "check", "\\u", "ride", "\\u", "requests_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "participati", "on_", "=_", "utils_", "._", "get", "\\u", "request", "ed", "\\u", "participati", "on_", "(_", "response_", "[_", "'", "value", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "participati", "on_", "[_", "'", "author", "'_", "]_", "[_", "'", "user", "name", "'_", "]_", "==_", "self_", "._", "ride", "r", "6_", "._", "username_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver_", "._", "ride", "\\u", "request_", "=_", "response_", "[_", "'", "value", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "finish", "\\u", "ride", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ride", "r_", "in_", "self_", "._", "ride", "rs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "hasattr_", "(_", "ride", "r_", ",_", "\"", "trip", "\"_", ")_", ":_", "\\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_", "response_", "=_", "ride", "r_", "._", "finish", "\\u", "ride", "_", "(_", "ride", "r_", "._", "trip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "ALL", "\\u", "OK_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Multipl", "e", "Match", "ing_", "(_", ")_", ":_", "\\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", "get", "\\u", "position", "\\u", "after", "\\u", "ride", "\\u", "finished_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "ride", "r_", "in_", "self_", "._", "ride", "rs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "=_", "self_", "._", "driver_", "._", "get", "\\u", "position_", "(_", "person_", "=_", "ride", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "response_", "[_", "'", "code", "'_", "]_", "==_", "response", "\\u", "codes_", "._", "FORB", "IDD", "EN_" ]
[ 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,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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
cournape/Bento/bento/private/_yaku/yaku/tools/pyext.py
[ { "content": "import sys\nimport os\nimport copy\nimport distutils\nimport distutils.sysconfig\nimport re\nimport warnings\nimport errno\n\nfrom subprocess \\\n import \\\n Popen, PIPE, STDOUT\n\nfrom yaku.task_manager \\\n import \\\n topo_sort, build_dag, \\\n CompiledTaskGen, set_extension_hook\nfrom yaku.sysconfig \\\n import \\\n get_configuration, detect_distutils_cc\nfrom yaku.compiled_fun \\\n import \\\n compile_fun\nfrom yaku.task \\\n import \\\n task_factory\nfrom yaku.utils \\\n import \\\n ensure_dir, get_exception\nfrom yaku.environment \\\n import \\\n Environment\nfrom yaku.conftests \\\n import \\\n check_compiler, check_header\nfrom yaku.tools.ctasks \\\n import \\\n apply_define\nfrom yaku.scheduler \\\n import \\\n run_tasks\nfrom yaku.conf \\\n import \\\n with_conf_blddir, create_file, write_log\nfrom yaku.errors \\\n import \\\n TaskRunFailure\nfrom yaku._config \\\n import \\\n _OUTPUT\nimport yaku.tools\n\npylink, pylink_vars = compile_fun(\"pylink\", \"${PYEXT_SHLINK} ${PYEXT_LINK_TGT_F}${TGT[0].abspath()} ${PYEXT_LINK_SRC_F}${SRC} ${PYEXT_APP_LIBDIR} ${PYEXT_APP_LIBS} ${PYEXT_APP_FRAMEWORKS} ${PYEXT_SHLINKFLAGS}\", False)\n\npycc, pycc_vars = compile_fun(\"pycc\", \"${PYEXT_CC} ${PYEXT_CFLAGS} ${PYEXT_INCPATH} ${PYEXT_CC_TGT_F}${TGT[0].abspath()} ${PYEXT_CC_SRC_F}${SRC}\", False)\n\npycxx, pycxx_vars = compile_fun(\"pycxx\", \"${PYEXT_CXX} ${PYEXT_CXXFLAGS} ${PYEXT_INCPATH} ${PYEXT_CXX_TGT_F}${TGT[0].abspath()} ${PYEXT_CXX_SRC_F}${SRC}\", False)\n\npycxxlink, pycxxlink_vars = compile_fun(\"pycxxlink\", \"${PYEXT_CXXSHLINK} ${PYEXT_LINK_TGT_F}${TGT[0].abspath()} ${PYEXT_LINK_SRC_F}${SRC} ${PYEXT_APP_LIBDIR} ${PYEXT_APP_LIBS} ${PYEXT_APP_FRAMEWORKS} ${PYEXT_SHLINKFLAGS}\", False)\n\n# pyext env <-> sysconfig env conversion\n\n_SYS_TO_PYENV = {\n \"PYEXT_SHCC\": \"CC\",\n \"PYEXT_CCSHARED\": \"CCSHARED\",\n \"PYEXT_SHLINK\": \"LDSHARED\",\n \"PYEXT_SUFFIX\": \"SO\",\n \"PYEXT_CFLAGS\": \"CFLAGS\",\n \"PYEXT_OPT\": \"OPT\",\n \"PYEXT_LIBDIR\": \"LIBDIR\",\n}\n\n_PYENV_REQUIRED = [\n \"LIBDIR_FMT\",\n \"LIBS\",\n \"LIB_FMT\",\n \"CPPPATH_FMT\",\n \"CC_TGT_F\",\n \"CC_SRC_F\",\n \"LINK_TGT_F\",\n \"LINK_SRC_F\",\n]\n\n_SYS_TO_CCENV = {\n \"CC\": \"CC\",\n \"SHCC\": \"CCSHARED\",\n \"SHLINK\": \"LDSHARED\",\n \"SO\": \"SO\",\n \"CFLAGS\": \"CFLAGS\",\n \"OPT\": \"OPT\",\n \"LIBDIR\": \"LIBDIR\",\n \"LIBDIR_FMT\": \"LIBDIR_FMT\",\n \"LIBS\": \"LIBS\",\n \"LIB_FMT\": \"LIB_FMT\",\n \"CPPPATH_FMT\": \"CPPPATH_FMT\",\n \"CC_TGT_F\": \"CC_TGT_F\",\n \"CC_SRC_F\": \"CC_SRC_F\",\n \"CXX\": \"CXX\",\n \"CXXSHLINK\": \"CXXSHLINK\",\n}\n\n\n\n\n\n\n\n# XXX: fix merge env location+api\n\n\nCC_SIGNATURE = {\n \"clang\": re.compile(\"clang version\"),\n \"gcc\": re.compile(\"gcc version\"),\n \"msvc\": re.compile(\"Microsoft \\(R\\) (32-bit |)C/C\\+\\+ Optimizing Compiler\")\n}\n\n\n\n\n\n\n\n\n# FIXME: find a way to reuse this kind of code between tools\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def setup_pyext_env(ctx, cc_type=\"default\", use_distutils=True):\n pyenv = Environment()\n if use_distutils:\n if cc_type == \"default\":\n dist_env = get_configuration()\n else:\n dist_env = get_configuration(cc_type)\n print(dist_env)\n for name, value in dist_env.items():\n pyenv[\"PYEXT_%s\" % name] = value\n pyenv[\"PYEXT_CFLAGS\"].extend(dist_env.get(\"SHARED\", []))\n pyenv[\"PYEXT_FMT\"] = \"%%s%s\" % dist_env[\"SO\"]\n pyenv[\"PYEXT_SHLINKFLAGS\"] = dist_env[\"LDFLAGS\"]\n else:\n old_env = ctx.env\n ctx.env = Environment()\n cc_env = None\n sys.path.insert(0, os.path.dirname(yaku.tools.__file__))\n try:\n try:\n mod = __import__(cc_type)\n mod.setup(ctx)\n except ImportError:\n raise RuntimeError(\"No tool %s is available (import failed)\" \\\n % cc_type)\n cc_env = ctx.env\n finally:\n sys.path.pop(0)\n ctx.env = old_env\n pyenv[\"PYEXT_CC\"] = cc_env[\"CC\"]\n pyenv[\"PYEXT_CFLAGS\"] = cc_env[\"CFLAGS\"]\n pyenv[\"PYEXT_LIBDIR\"] = cc_env[\"LIBDIR\"]\n pyenv[\"PYEXT_LIBS\"] = cc_env[\"LIBS\"]\n pyenv[\"PYEXT_FMT\"] = \"%s.so\"\n pyenv[\"PYEXT_SHLINK\"] = cc_env[\"MODLINK\"]\n pyenv[\"PYEXT_SHLINKFLAGS\"] = cc_env[\"MODLINKFLAGS\"]\n pyenv[\"PYEXT_CPPPATH\"] = cc_env[\"CPPPATH\"]\n pyenv.append(\"PYEXT_CPPPATH\", distutils.sysconfig.get_python_inc(), create=True)\n if sys.platform == \"win32\":\n pyenv.append(\"PYEXT_LIBDIR\", os.path.join(sys.exec_prefix, \"libs\"))\n\n return pyenv", "metadata": "root.setup_pyext_env", "header": "['module', '___EOS___']", "index": 101 }, { "content": "def pycc_hook(self, node):\n tasks = pycc_task(self, node)\n self.object_tasks.extend(tasks)\n return tasks", "metadata": "root.pycc_hook", "header": "['module', '___EOS___']", "index": 144 }, { "content": "def pycc_task(self, node):\n base = self.env[\"CC_OBJECT_FMT\"] % node.name\n target = node.parent.declare(base)\n ensure_dir(target.abspath())\n\n task = task_factory(\"pycc\")(inputs=[node], outputs=[target])\n task.gen = self\n task.env_vars = pycc_vars\n task.env = self.env\n task.func = pycc\n return [task]", "metadata": "root.pycc_task", "header": "['module', '___EOS___']", "index": 149 }, { "content": "def pycxx_hook(self, node):\n tasks = pycxx_task(self, node)\n self.object_tasks.extend(tasks)\n self.has_cxx = True\n return tasks", "metadata": "root.pycxx_hook", "header": "['module', '___EOS___']", "index": 161 }, { "content": "def pycxx_task(self, node):\n base = self.env[\"CXX_OBJECT_FMT\"] % node.name\n target = node.parent.declare(base)\n ensure_dir(target.abspath())\n\n task = task_factory(\"pycxx\")(inputs=[node], outputs=[target])\n task.gen = self\n task.env_vars = pycxx_vars\n task.env = self.env\n task.func = pycxx\n return [task]", "metadata": "root.pycxx_task", "header": "['module', '___EOS___']", "index": 167 }, { "content": "def pylink_task(self, name):\n objects = [tsk.outputs[0] for tsk in self.object_tasks]\n if len(objects) < 1:\n warnings.warn(\"task %s has no inputs !\" % name)\n def declare_target():\n folder, base = os.path.split(name)\n tmp = folder + os.path.sep + self.env[\"PYEXT_FMT\"] % base\n return self.bld.path.declare(tmp)\n target = declare_target()\n ensure_dir(target.abspath())\n\n task = task_factory(\"pylink\")(inputs=objects, outputs=[target])\n task.gen = self\n task.func = pylink\n task.env_vars = pylink_vars\n self.link_task = task\n\n return [task]", "metadata": "root.pylink_task", "header": "['module', '___EOS___']", "index": 179 }, { "content": "class PythonBuilder(yaku.tools.Builder):\n\n\n\n\n\n\n\n", "metadata": "root.PythonBuilder", "header": "['module', '___EOS___']", "index": 199 }, { "content": " def clone(self):\n return PythonBuilder(self.ctx)", "metadata": "root.PythonBuilder.clone", "header": "['class', 'PythonBuilder', '(', 'yaku', '.', 'tools', '.', 'Builder', ')', ':', '___EOS___']", "index": 200 }, { "content": " def __init__(self, ctx):\n yaku.tools.Builder.__init__(self, ctx)", "metadata": "root.PythonBuilder.__init__", "header": "['class', 'PythonBuilder', '(', 'yaku', '.', 'tools', '.', 'Builder', ')', ':', '___EOS___']", "index": 203 }, { "content": " def _compile(self, task_gen, name):\n apply_define(task_gen)\n apply_cpppath(task_gen)\n\n tasks = task_gen.process()\n for t in tasks:\n t.env = task_gen.env\n return tasks", "metadata": "root.PythonBuilder._compile", "header": "['class', 'PythonBuilder', '(', 'yaku', '.', 'tools', '.', 'Builder', ')', ':', '___EOS___']", "index": 206 }, { "content": " def try_compile(self, name, body, headers=None):\n old_hook = set_extension_hook(\".c\", pycc_task)\n try:\n return with_conf_blddir(self.ctx, name, body,\n lambda : yaku.tools.try_task_maker(self.ctx, self._compile, name, body, headers))\n finally:\n set_extension_hook(\".c\", old_hook)", "metadata": "root.PythonBuilder.try_compile", "header": "['class', 'PythonBuilder', '(', 'yaku', '.', 'tools', '.', 'Builder', ')', ':', '___EOS___']", "index": 215 }, { "content": " def try_extension(self, name, body, headers=None):\n old_hook = set_extension_hook(\".c\", pycc_task)\n try:\n return with_conf_blddir(self.ctx, name, body,\n lambda : yaku.tools.try_task_maker(self.ctx, self._extension, name, body, headers))\n finally:\n set_extension_hook(\".c\", old_hook)", "metadata": "root.PythonBuilder.try_extension", "header": "['class', 'PythonBuilder', '(', 'yaku', '.', 'tools', '.', 'Builder', ')', ':', '___EOS___']", "index": 223 }, { "content": " def _extension(self, task_gen, name):\n bld = self.ctx\n base = name.replace(\".\", os.sep)\n\n tasks = []\n\n old_hook = set_extension_hook(\".c\", pycc_hook)\n old_hook_cxx = set_extension_hook(\".cxx\", pycxx_hook)\n\n apply_define(task_gen)\n apply_cpppath(task_gen)\n apply_libpath(task_gen)\n apply_libs(task_gen)\n apply_frameworks(task_gen)\n\n tasks = task_gen.process()\n\n ltask = pylink_task(task_gen, base)\n task_gen.link_task = ltask\n if task_gen.has_cxx:\n task_gen.link_task[-1].func = pycxxlink\n task_gen.link_task[-1].env_vars = pycxxlink_vars\n\n tasks.extend(ltask)\n for t in tasks:\n t.env = task_gen.env\n\n set_extension_hook(\".c\", old_hook)\n set_extension_hook(\".cxx\", old_hook_cxx)\n return tasks", "metadata": "root.PythonBuilder._extension", "header": "['class', 'PythonBuilder', '(', 'yaku', '.', 'tools', '.', 'Builder', ')', ':', '___EOS___']", "index": 231 }, { "content": " def extension(self, name, sources, env=None):\n sources = self.to_nodes(sources)\n task_gen = CompiledTaskGen(\"pyext\", self.ctx, sources, name)\n task_gen.bld = self.ctx\n task_gen.env = yaku.tools._merge_env(self.env, env)\n tasks = self._extension(task_gen, name)\n self.ctx.tasks.extend(tasks)\n\n outputs = []\n for t in task_gen.link_task:\n outputs.extend(t.outputs)\n task_gen.outputs = outputs\n return tasks", "metadata": "root.PythonBuilder.extension", "header": "['class', 'PythonBuilder', '(', 'yaku', '.', 'tools', '.', 'Builder', ')', ':', '___EOS___']", "index": 262 }, { "content": " def try_extension(self, name, body, headers=None):\n return with_conf_blddir(self.ctx, name, body,\n lambda : yaku.tools.try_task_maker(self.ctx, self._extension, name, body, headers))", "metadata": "root.PythonBuilder.try_extension", "header": "['class', 'PythonBuilder', '(', 'yaku', '.', 'tools', '.', 'Builder', ')', ':', '___EOS___']", "index": 276 }, { "content": " def configure(self, candidates=None, use_distutils=True):\n ctx = self.ctx\n # How we do it\n # 1: for distutils-based configuration\n # - get compile/flags flags from sysconfig\n # - detect yaku tool name from CC used by distutils:\n # - get the compiler executable used by distutils ($CC\n # variable)\n # - try to determine yaku tool name from $CC\n # - apply necessary variables from yaku tool to $PYEXT_\n # \"namespace\"\n if candidates is None:\n compiler_type = \"default\"\n else:\n compiler_type = candidates[0]\n\n if use_distutils:\n dist_env = setup_pyext_env(ctx, compiler_type)\n ctx.env.update(dist_env)\n\n cc_exec = get_distutils_cc_exec(ctx, compiler_type)\n yaku_cc_type = detect_cc_type(ctx, cc_exec)\n if yaku_cc_type is None:\n raise ValueError(\"No adequate C compiler found (distutils mode)\")\n\n _setup_compiler(ctx, yaku_cc_type)\n\n cxx_exec = get_distutils_cxx_exec(ctx, compiler_type)\n yaku_cxx_type = detect_cxx_type(ctx, cxx_exec)\n if yaku_cxx_type is None:\n raise ValueError(\"No adequate CXX compiler found (distutils mode)\")\n\n _setup_cxxcompiler(ctx, yaku_cxx_type)\n else:\n dist_env = setup_pyext_env(ctx, compiler_type, False)\n ctx.env.update(dist_env)\n _setup_compiler(ctx, compiler_type)\n\n pycode = r\"\"\"\\\n#include <Python.h>\n#include <stdio.h>\n\nstatic PyObject*\nhello(PyObject *self, PyObject *args)\n{\n printf(\"Hello from C\\n\");\n Py_INCREF(Py_None);\n return Py_None;\n}\n\nstatic PyMethodDef HelloMethods[] = {\n {\"hello\", hello, METH_VARARGS, \"Print a hello world.\"},\n {NULL, NULL, 0, NULL} /* Sentinel */\n};\n\nPyMODINIT_FUNC\ninit_bar(void)\n{\n (void) Py_InitModule(\"_bar\", HelloMethods);\n}\n\"\"\"\n ctx.start_message(\"Checking whether %s can build python object code\" % compiler_type)\n try:\n self.try_compile(\"foo\", pycode)\n ctx.end_message(\"yes\")\n except TaskRunFailure:\n e = get_exception()\n ctx.end_message(\"no\")\n ctx.fail_configuration(str(e))\n\n ctx.start_message(\"Checking whether %s can build python extension\" % compiler_type)\n try:\n self.try_extension(\"foo\", pycode)\n ctx.end_message(\"yes\")\n except TaskRunFailure:\n e = get_exception()\n ctx.end_message(\"no\")\n ctx.fail_configuration(str(e))\n self.configured = True", "metadata": "root.PythonBuilder.configure", "header": "['class', 'PythonBuilder', '(', 'yaku', '.', 'tools', '.', 'Builder', ')', ':', '___EOS___']", "index": 280 }, { "content": "def get_builder(ctx):\n return PythonBuilder(ctx)", "metadata": "root.get_builder", "header": "['module', '___EOS___']", "index": 360 }, { "content": "def detect_cc_type(ctx, cc_cmd):\n return _detect_cc_type(ctx, cc_cmd)", "metadata": "root.detect_cc_type", "header": "['module', '___EOS___']", "index": 369 }, { "content": "def detect_cxx_type(ctx, cxx_cmd):\n cxx_type = _detect_cc_type(ctx, cxx_cmd)\n if cxx_type == \"gcc\":\n return \"gxx\"\n else:\n return cxx_type", "metadata": "root.detect_cxx_type", "header": "['module', '___EOS___']", "index": 372 }, { "content": "def _detect_cc_type(ctx, cc_cmd):\n cc_type = None\n\n def detect_type(vflag):\n cmd = cc_cmd + [vflag]\n env = os.environ\n env[\"LC_ALL\"] = env[\"LANGUAGE\"] = \"C\"\n p = Popen(cmd, stdout=PIPE, stderr=STDOUT, env=env)\n out = p.communicate()[0].decode()\n for k, v in CC_SIGNATURE.items():\n m = v.search(out)\n if m:\n return k\n return None\n\n _OUTPUT.write(\"Detecting CC type... \")\n if sys.platform == \"win32\":\n for v in [\"\", \"-v\"]:\n cc_type = detect_type(v)\n else:\n try:\n for v in [\"-v\", \"-V\", \"-###\"]:\n cc_type = detect_type(v)\n if cc_type:\n break\n if cc_type is None:\n cc_type = \"cc\"\n except OSError:\n e = extract_exception()\n if e.errno == errno.ENOENT:\n raise ValueError(\"compiler %r not found\" % \" \".join(cc_cmd))\n else:\n raise ValueError(\"Unexpected error %r when testing compiler %r\" % (e, cc_cmd))\n _OUTPUT.write(\"%s\\n\" % cc_type)\n return cc_type", "metadata": "root._detect_cc_type", "header": "['module', '___EOS___']", "index": 379 }, { "content": "def get_distutils_cc_exec(ctx, compiler_type=\"default\"):\n from distutils import ccompiler\n from distutils.sysconfig import customize_compiler\n\n _OUTPUT.write(\"Detecting distutils CC exec ... \")\n if compiler_type == \"default\":\n compiler_type = \\\n distutils.ccompiler.get_default_compiler()\n\n compiler = ccompiler.new_compiler(compiler=compiler_type)\n customize_compiler(compiler)\n if compiler_type == \"msvc\":\n compiler.initialize()\n cc = [compiler.cc]\n else:\n cc = compiler.compiler_so[:1]\n _OUTPUT.write(\"%s\\n\" % \" \".join(cc))\n return cc", "metadata": "root.get_distutils_cc_exec", "header": "['module', '___EOS___']", "index": 415 }, { "content": "def get_distutils_cxx_exec(ctx, compiler_type=\"default\"):\n from distutils import ccompiler\n from distutils.sysconfig import customize_compiler\n\n _OUTPUT.write(\"Detecting distutils CXX exec ... \")\n if compiler_type == \"default\":\n compiler_type = \\\n distutils.ccompiler.get_default_compiler()\n\n compiler = ccompiler.new_compiler(compiler=compiler_type)\n if compiler_type == \"msvc\":\n compiler.initialize()\n cc = [compiler.cc]\n else:\n customize_compiler(compiler)\n cc = compiler.compiler_cxx\n _OUTPUT.write(\"%s\\n\" % \" \".join(cc))\n return cc", "metadata": "root.get_distutils_cxx_exec", "header": "['module', '___EOS___']", "index": 434 }, { "content": "def _setup_compiler(ctx, cc_type):\n old_env = ctx.env\n ctx.env = Environment()\n cc_env = None\n sys.path.insert(0, os.path.dirname(yaku.tools.__file__))\n try:\n try:\n mod = __import__(cc_type)\n mod.setup(ctx)\n except ImportError:\n raise RuntimeError(\"No tool %s is available (import failed)\" \\\n % cc_type)\n\n # XXX: this is ugly - find a way to have tool-specific env...\n cc_env = ctx.env\n finally:\n sys.path.pop(0)\n ctx.env = old_env\n\n copied_values = [\"CC\", \"CPPPATH_FMT\", \"LIBDIR_FMT\", \"LIB_FMT\",\n \"CC_OBJECT_FMT\", \"CC_TGT_F\", \"CC_SRC_F\", \"LINK_TGT_F\",\n \"LINK_SRC_F\", \"SHLINK\"]\n for k in copied_values:\n ctx.env[\"PYEXT_%s\" % k] = cc_env[k]\n ctx.env.prextend(\"PYEXT_CPPPATH\", cc_env[\"CPPPATH\"])\n ctx.env.prextend(\"PYEXT_LIBDIR\", cc_env[\"LIBDIR\"])", "metadata": "root._setup_compiler", "header": "['module', '___EOS___']", "index": 453 }, { "content": "def _setup_cxxcompiler(ctx, cxx_type):\n old_env = ctx.env\n ctx.env = Environment()\n sys.path.insert(0, os.path.dirname(yaku.tools.__file__))\n try:\n mod = __import__(cxx_type)\n mod.setup(ctx)\n cxx_env = ctx.env\n finally:\n sys.path.pop(0)\n ctx.env = old_env\n\n for k in [\"CXX\", \"CXXFLAGS\", \"CXX_TGT_F\", \"CXX_SRC_F\",\n \"CXXSHLINK\"]:\n ctx.env[\"PYEXT_%s\" % k] = cxx_env[k]", "metadata": "root._setup_cxxcompiler", "header": "['module', '___EOS___']", "index": 480 }, { "content": "def apply_frameworks(task_gen):\n # XXX: do this correctly (platform specific tool config)\n if sys.platform == \"darwin\":\n frameworks = task_gen.env.get(\"PYEXT_FRAMEWORKS\", [])\n task_gen.env[\"PYEXT_APP_FRAMEWORKS\"] = []\n for framework in frameworks:\n task_gen.env[\"PYEXT_APP_FRAMEWORKS\"].extend([\"-framework\", framework])\n else:\n task_gen.env[\"PYEXT_APP_FRAMEWORKS\"] = []", "metadata": "root.apply_frameworks", "header": "['module', '___EOS___']", "index": 497 }, { "content": "def apply_libs(task_gen):\n libs = task_gen.env[\"PYEXT_LIBS\"]\n task_gen.env[\"PYEXT_APP_LIBS\"] = [\n task_gen.env[\"PYEXT_LIB_FMT\"] % lib for lib in libs]", "metadata": "root.apply_libs", "header": "['module', '___EOS___']", "index": 507 }, { "content": "def apply_libpath(task_gen):\n libdir = task_gen.env[\"PYEXT_LIBDIR\"]\n #implicit_paths = set([\n # os.path.join(task_gen.env[\"BLDDIR\"], os.path.dirname(s))\n # for s in task_gen.sources])\n implicit_paths = []\n libdir = list(implicit_paths) + libdir\n task_gen.env[\"PYEXT_APP_LIBDIR\"] = [\n task_gen.env[\"PYEXT_LIBDIR_FMT\"] % d for d in libdir]", "metadata": "root.apply_libpath", "header": "['module', '___EOS___']", "index": 512 }, { "content": "def apply_cpppath(task_gen):\n cpppaths = task_gen.env[\"PYEXT_CPPPATH\"]\n implicit_paths = set([s.parent.srcpath() \\\n for s in task_gen.sources])\n srcnode = task_gen.sources[0].ctx.srcnode\n\n relcpppaths = []\n for p in cpppaths:\n if not os.path.isabs(p):\n node = srcnode.find_node(p)\n assert node is not None, \"could not find %s\" % p\n relcpppaths.append(node.bldpath())\n else:\n relcpppaths.append(p)\n cpppaths = list(implicit_paths) + relcpppaths\n task_gen.env[\"PYEXT_INCPATH\"] = [\n task_gen.env[\"PYEXT_CPPPATH_FMT\"] % p\n for p in cpppaths]", "metadata": "root.apply_cpppath", "header": "['module', '___EOS___']", "index": 522 } ]
[ { "span": "import copy", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 11 }, { "span": "from yaku.task_manager \\\n import \\\n topo_sort, build_dag, \\\n CompiledTaskGen, set_extension_hook", "start_line": 13, "start_column": 0, "end_line": 16, "end_column": 43 }, { "span": "from yaku.sysconfig \\\n import \\\n get_configuration, detect_distutils_cc", "start_line": 17, "start_column": 0, "end_line": 19, "end_column": 46 }, { "span": "from yaku.conftests \\\n import \\\n check_compiler, check_header", "start_line": 32, "start_column": 0, "end_line": 34, "end_column": 36 }, { "span": "from yaku.scheduler \\\n import \\\n run_tasks", "start_line": 38, "start_column": 0, "end_line": 40, "end_column": 17 }, { "span": "from yaku.conf \\\n import \\\n with_conf_blddir, create_file, write_log", "start_line": 41, "start_column": 0, "end_line": 43, "end_column": 48 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "distutils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "distutils_", "._", "sysconfig", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "warnings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "errno_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "subprocess_", "import_", "Popen_", ",_", "PIPE_", ",_", "STDOUT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "yak", "u_", "._", "task", "\\u", "manager_", "import_", "topo", "\\u", "sort_", ",_", "build", "\\u", "dag_", ",_", "Compiled", "Task", "Gen_", ",_", "set\\u", "extensi", "on", "\\u", "hook_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "yak", "u_", "._", "sysconfig", "_", "import_", "get", "\\u", "configuration_", ",_", "detect", "\\u", "distutils", "\\u", "cc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "yak", "u_", "._", "compile", "d\\u", "fun_", "import_", "compile", "\\u", "fun_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "yak", "u_", "._", "task_", "import_", "task", "\\u", "factory_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "yak", "u_", "._", "utils_", "import_", "ensure", "\\u", "dir_", ",_", "get", "\\u", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "yak", "u_", "._", "environment_", "import_", "Environment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "yak", "u_", "._", "conftest", "s_", "import_", "check", "\\u", "compiler_", ",_", "check", "\\u", "header_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "yak", "u_", "._", "tools_", "._", "cta", "sk", "s_", "import_", "appl", "y", "\\u", "define_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "yak", "u_", "._", "scheduler_", "import_", "run", "\\u", "tasks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "yak", "u_", "._", "conf_", "import_", "with", "\\u", "conf", "\\u", "bld", "dir_", ",_", "create", "\\u", "file_", ",_", "write", "\\u", "log_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "yak", "u_", "._", "errors_", "import_", "Task", "Run", "Failure_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "yak", "u_", "._", "\\u", "config_", "import_", "\\u", "OUTPUT_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "yak", "u_", "._", "tools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pyli", "nk_", ",_", "pyli", "nk", "\\u", "vars_", "=_", "compile", "\\u", "fun_", "(_", "\"", "pyli", "nk", "\"_", ",_", "\"$", "{", "PY", "EXT", "\\u", "SH", "LINK", "}", " ", "${", "PY", "EXT", "\\u", "LINK", "\\u", "TGT", "\\u", "F", "}$", "{", "TGT", "[", "0", "].", "abs", "path", "()}", " ", "${", "PY", "EXT", "\\u", "LINK", "\\u", "SR", "C", "\\u", "F", "}$", "{", "SR", "C", "}", " ", "${", "PY", "EXT", "\\u", "APP", "\\u", "LIB", "DIR", "}", " ", "${", "PY", "EXT", "\\u", "APP", "\\u", "LIBS", "}", " ", "${", "PY", "EXT", "\\u", "APP", "\\u", "FRAME", "WORKS", "}", " ", "${", "PY", "EXT", "\\u", "SH", "LINK", "FLAG", "S", "}\"_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pyc", "c_", ",_", "pyc", "c\\u", "vars_", "=_", "compile", "\\u", "fun_", "(_", "\"", "pyc", "c", "\"_", ",_", "\"$", "{", "PY", "EXT", "\\u", "CC", "}", " ", "${", "PY", "EXT", "\\u", "CFLAGS", "}", " ", "${", "PY", "EXT", "\\u", "INC", "PATH", "}", " ", "${", "PY", "EXT", "\\u", "CC", "\\u", "TGT", "\\u", "F", "}$", "{", "TGT", "[", "0", "].", "abs", "path", "()}", " ", "${", "PY", "EXT", "\\u", "CC", "\\u", "SR", "C", "\\u", "F", "}$", "{", "SR", "C", "}\"_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pyc", "xx_", ",_", "pyc", "xx", "\\u", "vars_", "=_", "compile", "\\u", "fun_", "(_", "\"", "pyc", "xx", "\"_", ",_", "\"$", "{", "PY", "EXT", "\\u", "CXX", "}", " ", "${", "PY", "EXT", "\\u", "CXX", "FLAG", "S", "}", " ", "${", "PY", "EXT", "\\u", "INC", "PATH", "}", " ", "${", "PY", "EXT", "\\u", "CXX", "\\u", "TGT", "\\u", "F", "}$", "{", "TGT", "[", "0", "].", "abs", "path", "()}", " ", "${", "PY", "EXT", "\\u", "CXX", "\\u", "SR", "C", "\\u", "F", "}$", "{", "SR", "C", "}\"_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pyc", "xx", "link_", ",_", "pyc", "xx", "link", "\\u", "vars_", "=_", "compile", "\\u", "fun_", "(_", "\"", "pyc", "xx", "link", "\"_", ",_", "\"$", "{", "PY", "EXT", "\\u", "CXX", "SH", "LINK", "}", " ", "${", "PY", "EXT", "\\u", "LINK", "\\u", "TGT", "\\u", "F", "}$", "{", "TGT", "[", "0", "].", "abs", "path", "()}", " ", "${", "PY", "EXT", "\\u", "LINK", "\\u", "SR", "C", "\\u", "F", "}$", "{", "SR", "C", "}", " ", "${", "PY", "EXT", "\\u", "APP", "\\u", "LIB", "DIR", "}", " ", "${", "PY", "EXT", "\\u", "APP", "\\u", "LIBS", "}", " ", "${", "PY", "EXT", "\\u", "APP", "\\u", "FRAME", "WORKS", "}", " ", "${", "PY", "EXT", "\\u", "SH", "LINK", "FLAG", "S", "}\"_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pye", "xt", " ", "env", " ", "<-", ">", " ", "sysconfig", " ", "env", " ", "conversion_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "SYS", "\\u", "TO", "\\u", "PY", "ENV_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "PY", "EXT", "\\u", "SH", "CC", "\"_", ":_", "\"", "CC", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "PY", "EXT", "\\u", "CCS", "HAR", "ED", "\"_", ":_", "\"", "CCS", "HAR", "ED", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "PY", "EXT", "\\u", "SH", "LINK", "\"_", ":_", "\"", "LD", "SHARED", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "PY", "EXT", "\\u", "SUFFIX", "\"_", ":_", "\"", "SO", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "PY", "EXT", "\\u", "CFLAGS", "\"_", ":_", "\"", "CFLAGS", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "PY", "EXT", "\\u", "OPT", "\"_", ":_", "\"", "OPT", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "PY", "EXT", "\\u", "LIB", "DIR", "\"_", ":_", "\"", "LIB", "DIR", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "PY", "ENV", "\\u", "REQUIRED_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "LIB", "DIR", "\\u", "FMT", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "LIBS", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "LIB", "\\u", "FMT", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CPP", "PATH", "\\u", "FMT", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CC", "\\u", "TGT", "\\u", "F", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CC", "\\u", "SR", "C", "\\u", "F", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "LINK", "\\u", "TGT", "\\u", "F", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "LINK", "\\u", "SR", "C", "\\u", "F", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "SYS", "\\u", "TO", "\\u", "CC", "ENV_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CC", "\"_", ":_", "\"", "CC", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "SH", "CC", "\"_", ":_", "\"", "CCS", "HAR", "ED", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "SH", "LINK", "\"_", ":_", "\"", "LD", "SHARED", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "SO", "\"_", ":_", "\"", "SO", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CFLAGS", "\"_", ":_", "\"", "CFLAGS", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "OPT", "\"_", ":_", "\"", "OPT", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "LIB", "DIR", "\"_", ":_", "\"", "LIB", "DIR", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "LIB", "DIR", "\\u", "FMT", "\"_", ":_", "\"", "LIB", "DIR", "\\u", "FMT", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "LIBS", "\"_", ":_", "\"", "LIBS", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "LIB", "\\u", "FMT", "\"_", ":_", "\"", "LIB", "\\u", "FMT", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CPP", "PATH", "\\u", "FMT", "\"_", ":_", "\"", "CPP", "PATH", "\\u", "FMT", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CC", "\\u", "TGT", "\\u", "F", "\"_", ":_", "\"", "CC", "\\u", "TGT", "\\u", "F", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CC", "\\u", "SR", "C", "\\u", "F", "\"_", ":_", "\"", "CC", "\\u", "SR", "C", "\\u", "F", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CXX", "\"_", ":_", "\"", "CXX", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CXX", "SH", "LINK", "\"_", ":_", "\"", "CXX", "SH", "LINK", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", ":", " ", "fix", " ", "merge", " ", "env", " ", "location", "+", "api_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "CC", "\\u", "SIGNATURE", "_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "clang", "\"_", ":_", "re_", "._", "compile_", "(_", "\"", "clang", " ", "version", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "gcc", "\"_", ":_", "re_", "._", "compile_", "(_", "\"", "gcc", " ", "version", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "msvc", "\"_", ":_", "re_", "._", "compile_", "(_", "\"", "Micro", "soft", " ", "\\\\(", "R", "\\\\)", " ", "(", "32", "-", "bit", " ", "|)", "C", "/", "C", "\\\\+", "\\\\+", " ", "Optim", "izi", "ng", " ", "Compil", "er", "\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "FIX", "ME", ":", " ", "find", " ", "a", " ", "way", " ", "to", " ", "reus", "e", " ", "this", " ", "kind", " ", "of", " ", "code", " ", "bet", "ween", " ", "tools_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "setup", "\\u", "pye", "xt\\u", "env_", "(_", "ctx_", ",_", "cc", "\\u", "type_", "=_", "\"", "default", "\"_", ",_", "use", "\\u", "distutils_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pye", "nv_", "=_", "Environment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "use", "\\u", "distutils_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cc", "\\u", "type_", "==_", "\"", "default", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dist", "\\u", "env_", "=_", "get", "\\u", "configuration_", "(_", ")_", "\\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 ", " _", "dist", "\\u", "env_", "=_", "get", "\\u", "configuration_", "(_", "cc", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "dist", "\\u", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "name_", ",_", "value_", "in_", "dist", "\\u", "env_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pye", "nv_", "[_", "\"", "PY", "EXT", "\\u", "%", "s", "\"_", "%_", "name_", "]_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pye", "nv_", "[_", "\"", "PY", "EXT", "\\u", "CFLAGS", "\"_", "]_", "._", "extend_", "(_", "dist", "\\u", "env_", "._", "get_", "(_", "\"", "SHARED", "\"_", ",_", "[_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pye", "nv_", "[_", "\"", "PY", "EXT", "\\u", "FMT", "\"_", "]_", "=_", "\"%%", "s", "%", "s", "\"_", "%_", "dist", "\\u", "env_", "[_", "\"", "SO", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pye", "nv_", "[_", "\"", "PY", "EXT", "\\u", "SH", "LINK", "FLAG", "S", "\"_", "]_", "=_", "dist", "\\u", "env_", "[_", "\"", "LD", "FLAG", "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 ", " _", "old", "\\u", "env_", "=_", "ctx_", "._", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "=_", "Environment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cc", "\\u", "env_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "os_", "._", "path_", "._", "dirname_", "(_", "yak", "u_", "._", "tools_", "._", "\\u\\u", "file\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\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 ", " _", "mod_", "=_", "\\u\\u", "import\\u\\u_", "(_", "cc", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mod_", "._", "setup_", "(_", "ctx_", ")_", "\\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 ", " _", "raise_", "Run", "time", "Error_", "(_", "\"", "No", " ", "tool", " ", "%", "s", " ", "is", " ", "avail", "able", " ", "(", "import", " ", "fail", "ed", ")\"_", "%_", "cc", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cc", "\\u", "env_", "=_", "ctx_", "._", "env_", "\\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 ", " _", "sys_", "._", "path_", "._", "pop_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "=_", "old", "\\u", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pye", "nv_", "[_", "\"", "PY", "EXT", "\\u", "CC", "\"_", "]_", "=_", "cc", "\\u", "env_", "[_", "\"", "CC", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pye", "nv_", "[_", "\"", "PY", "EXT", "\\u", "CFLAGS", "\"_", "]_", "=_", "cc", "\\u", "env_", "[_", "\"", "CFLAGS", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pye", "nv_", "[_", "\"", "PY", "EXT", "\\u", "LIB", "DIR", "\"_", "]_", "=_", "cc", "\\u", "env_", "[_", "\"", "LIB", "DIR", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pye", "nv_", "[_", "\"", "PY", "EXT", "\\u", "LIBS", "\"_", "]_", "=_", "cc", "\\u", "env_", "[_", "\"", "LIBS", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pye", "nv_", "[_", "\"", "PY", "EXT", "\\u", "FMT", "\"_", "]_", "=_", "\"%", "s", ".", "so", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pye", "nv_", "[_", "\"", "PY", "EXT", "\\u", "SH", "LINK", "\"_", "]_", "=_", "cc", "\\u", "env_", "[_", "\"", "MOD", "LINK", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pye", "nv_", "[_", "\"", "PY", "EXT", "\\u", "SH", "LINK", "FLAG", "S", "\"_", "]_", "=_", "cc", "\\u", "env_", "[_", "\"", "MOD", "LINK", "FLAG", "S", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pye", "nv_", "[_", "\"", "PY", "EXT", "\\u", "CPP", "PATH", "\"_", "]_", "=_", "cc", "\\u", "env_", "[_", "\"", "CPP", "PATH", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pye", "nv_", "._", "append_", "(_", "\"", "PY", "EXT", "\\u", "CPP", "PATH", "\"_", ",_", "distutils_", "._", "sysconfig", "_", "._", "get", "\\u", "python", "\\u", "inc_", "(_", ")_", ",_", "create_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sys_", "._", "platform_", "==_", "\"", "win32", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pye", "nv_", "._", "append_", "(_", "\"", "PY", "EXT", "\\u", "LIB", "DIR", "\"_", ",_", "os_", "._", "path_", "._", "join_", "(_", "sys_", "._", "exec", "\\u", "prefix_", ",_", "\"", "libs", "\"_", ")_", ")_", "\\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_", "pye", "nv_", "\\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_", "pyc", "c\\u", "hook_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tasks_", "=_", "pyc", "c\\u", "task_", "(_", "self_", ",_", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "object\\u", "tasks_", "._", "extend_", "(_", "tasks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tasks_", "\\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_", "pyc", "c\\u", "task_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base_", "=_", "self_", "._", "env_", "[_", "\"", "CC", "\\u", "OBJ", "ECT", "\\u", "FMT", "\"_", "]_", "%_", "node_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "node_", "._", "parent_", "._", "declare_", "(_", "base_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensure", "\\u", "dir_", "(_", "target_", "._", "abspath_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "task_", "=_", "task", "\\u", "factory_", "(_", "\"", "pyc", "c", "\"_", ")_", "(_", "inputs_", "=_", "[_", "node_", "]_", ",_", "outputs_", "=_", "[_", "target_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task_", "._", "gen_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task_", "._", "env", "\\u", "vars_", "=_", "pyc", "c\\u", "vars_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task_", "._", "env_", "=_", "self_", "._", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task_", "._", "func_", "=_", "pyc", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "task_", "]_", "\\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_", "pyc", "xx", "\\u", "hook_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tasks_", "=_", "pyc", "xx", "\\u", "task_", "(_", "self_", ",_", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "object\\u", "tasks_", "._", "extend_", "(_", "tasks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "has", "\\u", "cxx", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tasks_", "\\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_", "pyc", "xx", "\\u", "task_", "(_", "self_", ",_", "node_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "base_", "=_", "self_", "._", "env_", "[_", "\"", "CXX", "\\u", "OBJ", "ECT", "\\u", "FMT", "\"_", "]_", "%_", "node_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target_", "=_", "node_", "._", "parent_", "._", "declare_", "(_", "base_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensure", "\\u", "dir_", "(_", "target_", "._", "abspath_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "task_", "=_", "task", "\\u", "factory_", "(_", "\"", "pyc", "xx", "\"_", ")_", "(_", "inputs_", "=_", "[_", "node_", "]_", ",_", "outputs_", "=_", "[_", "target_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task_", "._", "gen_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task_", "._", "env", "\\u", "vars_", "=_", "pyc", "xx", "\\u", "vars_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task_", "._", "env_", "=_", "self_", "._", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task_", "._", "func_", "=_", "pyc", "xx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "task_", "]_", "\\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_", "pyli", "nk", "\\u", "task_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "objects_", "=_", "[_", "tsk", "_", "._", "outputs_", "[_", "0_", "]_", "for_", "tsk", "_", "in_", "self_", "._", "object\\u", "tasks_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "objects_", ")_", "<_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "warn_", "(_", "\"", "task", " ", "%", "s", " ", "has", " ", "no", " ", "inputs", " ", "!\"_", "%_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "declar", "e\\u", "target_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "folder_", ",_", "base_", "=_", "os_", "._", "path_", "._", "split_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "=_", "folder_", "+_", "os_", "._", "path_", "._", "sep_", "+_", "self_", "._", "env_", "[_", "\"", "PY", "EXT", "\\u", "FMT", "\"_", "]_", "%_", "base_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "bld", "_", "._", "path_", "._", "declare_", "(_", "tmp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "target_", "=_", "declar", "e\\u", "target_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ensure", "\\u", "dir_", "(_", "target_", "._", "abspath_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "task_", "=_", "task", "\\u", "factory_", "(_", "\"", "pyli", "nk", "\"_", ")_", "(_", "inputs_", "=_", "objects_", ",_", "outputs_", "=_", "[_", "target_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task_", "._", "gen_", "=_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task_", "._", "func_", "=_", "pyli", "nk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task_", "._", "env", "\\u", "vars_", "=_", "pyli", "nk", "\\u", "vars_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "link", "\\u", "task_", "=_", "task_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "[_", "task_", "]_", "\\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_", "Pyth", "on", "Builder_", "(_", "yak", "u_", "._", "tools_", "._", "Builder_", ")_", ":_", "\\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_", "Pyth", "on", "Builder_", "(_", "yak", "u_", "._", "tools_", "._", "Builder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "clone_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Pyth", "on", "Builder_", "(_", "self_", "._", "ctx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pyth", "on", "Builder_", "(_", "yak", "u_", "._", "tools_", "._", "Builder_", ")_", ":_", "\\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_", ",_", "ctx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yak", "u_", "._", "tools_", "._", "Builder_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "ctx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pyth", "on", "Builder_", "(_", "yak", "u_", "._", "tools_", "._", "Builder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "compile_", "(_", "self_", ",_", "task", "\\u", "gen_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "appl", "y", "\\u", "define_", "(_", "task", "\\u", "gen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "appl", "y", "\\u", "cpp", "path_", "(_", "task", "\\u", "gen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tasks_", "=_", "task", "\\u", "gen_", "._", "process_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "tasks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "env_", "=_", "task", "\\u", "gen_", "._", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "tasks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pyth", "on", "Builder_", "(_", "yak", "u_", "._", "tools_", "._", "Builder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "try", "\\u", "compile_", "(_", "self_", ",_", "name_", ",_", "body_", ",_", "headers_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "hook_", "=_", "set\\u", "extensi", "on", "\\u", "hook_", "(_", "\".", "c", "\"_", ",_", "pyc", "c\\u", "task_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "with", "\\u", "conf", "\\u", "bld", "dir_", "(_", "self_", "._", "ctx_", ",_", "name_", ",_", "body_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", ":_", "yak", "u_", "._", "tools_", "._", "try", "\\u", "task", "\\u", "maker_", "(_", "self_", "._", "ctx_", ",_", "self_", "._", "\\u", "compile_", ",_", "name_", ",_", "body_", ",_", "headers_", ")_", ")_", "\\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 ", " _", "set\\u", "extensi", "on", "\\u", "hook_", "(_", "\".", "c", "\"_", ",_", "old", "\\u", "hook_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pyth", "on", "Builder_", "(_", "yak", "u_", "._", "tools_", "._", "Builder_", ")_", ":_", "\\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_", "try", "\\u", "extension_", "(_", "self_", ",_", "name_", ",_", "body_", ",_", "headers_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "hook_", "=_", "set\\u", "extensi", "on", "\\u", "hook_", "(_", "\".", "c", "\"_", ",_", "pyc", "c\\u", "task_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "with", "\\u", "conf", "\\u", "bld", "dir_", "(_", "self_", "._", "ctx_", ",_", "name_", ",_", "body_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", ":_", "yak", "u_", "._", "tools_", "._", "try", "\\u", "task", "\\u", "maker_", "(_", "self_", "._", "ctx_", ",_", "self_", "._", "\\u", "extension_", ",_", "name_", ",_", "body_", ",_", "headers_", ")_", ")_", "\\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 ", " _", "set\\u", "extensi", "on", "\\u", "hook_", "(_", "\".", "c", "\"_", ",_", "old", "\\u", "hook_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pyth", "on", "Builder_", "(_", "yak", "u_", "._", "tools_", "._", "Builder_", ")_", ":_", "\\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", "extension_", "(_", "self_", ",_", "task", "\\u", "gen_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bld", "_", "=_", "self_", "._", "ctx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "base_", "=_", "name_", "._", "replace_", "(_", "\".\"_", ",_", "os_", "._", "sep_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tasks_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "old", "\\u", "hook_", "=_", "set\\u", "extensi", "on", "\\u", "hook_", "(_", "\".", "c", "\"_", ",_", "pyc", "c\\u", "hook_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "hook", "\\u", "cxx", "_", "=_", "set\\u", "extensi", "on", "\\u", "hook_", "(_", "\".", "cxx", "\"_", ",_", "pyc", "xx", "\\u", "hook_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "appl", "y", "\\u", "define_", "(_", "task", "\\u", "gen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "appl", "y", "\\u", "cpp", "path_", "(_", "task", "\\u", "gen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "appl", "y", "\\u", "libpa", "th_", "(_", "task", "\\u", "gen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "appl", "y", "\\u", "libs_", "(_", "task", "\\u", "gen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "appl", "y", "\\u", "frameworks", "_", "(_", "task", "\\u", "gen_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tasks_", "=_", "task", "\\u", "gen_", "._", "process_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lta", "sk_", "=_", "pyli", "nk", "\\u", "task_", "(_", "task", "\\u", "gen_", ",_", "base_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task", "\\u", "gen_", "._", "link", "\\u", "task_", "=_", "lta", "sk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "task", "\\u", "gen_", "._", "has", "\\u", "cxx", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "task", "\\u", "gen_", "._", "link", "\\u", "task_", "[_", "-_", "1_", "]_", "._", "func_", "=_", "pyc", "xx", "link_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task", "\\u", "gen_", "._", "link", "\\u", "task_", "[_", "-_", "1_", "]_", "._", "env", "\\u", "vars_", "=_", "pyc", "xx", "link", "\\u", "vars_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tasks_", "._", "extend_", "(_", "lta", "sk_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "tasks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "._", "env_", "=_", "task", "\\u", "gen_", "._", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "set\\u", "extensi", "on", "\\u", "hook_", "(_", "\".", "c", "\"_", ",_", "old", "\\u", "hook_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "extensi", "on", "\\u", "hook_", "(_", "\".", "cxx", "\"_", ",_", "old", "\\u", "hook", "\\u", "cxx", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tasks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pyth", "on", "Builder_", "(_", "yak", "u_", "._", "tools_", "._", "Builder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "extension_", "(_", "self_", ",_", "name_", ",_", "sources_", ",_", "env_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sources_", "=_", "self_", "._", "to", "\\u", "nodes_", "(_", "sources_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task", "\\u", "gen_", "=_", "Compiled", "Task", "Gen_", "(_", "\"", "pye", "xt", "\"_", ",_", "self_", "._", "ctx_", ",_", "sources_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task", "\\u", "gen_", "._", "bld", "_", "=_", "self_", "._", "ctx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task", "\\u", "gen_", "._", "env_", "=_", "yak", "u_", "._", "tools_", "._", "\\u", "merge", "\\u", "env_", "(_", "self_", "._", "env_", ",_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tasks_", "=_", "self_", "._", "\\u", "extension_", "(_", "task", "\\u", "gen_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "ctx_", "._", "tasks_", "._", "extend_", "(_", "tasks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "outputs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "t_", "in_", "task", "\\u", "gen_", "._", "link", "\\u", "task_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "outputs_", "._", "extend_", "(_", "t_", "._", "outputs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "task", "\\u", "gen_", "._", "outputs_", "=_", "outputs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "tasks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pyth", "on", "Builder_", "(_", "yak", "u_", "._", "tools_", "._", "Builder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "try", "\\u", "extension_", "(_", "self_", ",_", "name_", ",_", "body_", ",_", "headers_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "with", "\\u", "conf", "\\u", "bld", "dir_", "(_", "self_", "._", "ctx_", ",_", "name_", ",_", "body_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", ":_", "yak", "u_", "._", "tools_", "._", "try", "\\u", "task", "\\u", "maker_", "(_", "self_", "._", "ctx_", ",_", "self_", "._", "\\u", "extension_", ",_", "name_", ",_", "body_", ",_", "headers_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Pyth", "on", "Builder_", "(_", "yak", "u_", "._", "tools_", "._", "Builder_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "configure_", "(_", "self_", ",_", "candidates_", "=_", "None_", ",_", "use", "\\u", "distutils_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "=_", "self_", "._", "ctx_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ho", "w", " ", "we", " ", "do", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", ":", " ", "for", " ", "distutils", "-", "based", " ", "configuration_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "-", " ", "get", " ", "compile", "/", "flags", " ", "flags", " ", "from", " ", "sysconfig", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "-", " ", "detect", " ", "yak", "u", " ", "tool", " ", "name", " ", "from", " ", "CC", " ", "used", " ", "by", " ", "distutils", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "-", " ", "get", " ", "the", " ", "compiler", " ", "executable", " ", "used", " ", "by", " ", "distutils", " ", "($", "CC_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "variab", "le", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "-", " ", "try", " ", "to", " ", "dete", "rmin", "e", " ", "yak", "u", " ", "tool", " ", "name", " ", "from", " ", "$", "CC_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "-", " ", "appl", "y", " ", "necessar", "y", " ", "variab", "les", " ", "from", " ", "yak", "u", " ", "tool", " ", "to", " ", "$", "PY", "EXT", "\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "\"", "namespace", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "candidates_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "compiler", "\\u", "type_", "=_", "\"", "default", "\"_", "\\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 ", " _", "compiler", "\\u", "type_", "=_", "candidates_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "use", "\\u", "distutils_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dist", "\\u", "env_", "=_", "setup", "\\u", "pye", "xt\\u", "env_", "(_", "ctx_", ",_", "compiler", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "._", "update_", "(_", "dist", "\\u", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cc", "\\u", "exec_", "=_", "get", "\\u", "distutils", "\\u", "cc", "\\u", "exec_", "(_", "ctx_", ",_", "compiler", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yak", "u\\u", "cc", "\\u", "type_", "=_", "detect", "\\u", "cc", "\\u", "type_", "(_", "ctx_", ",_", "cc", "\\u", "exec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "yak", "u\\u", "cc", "\\u", "type_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "No", " ", "ade", "quat", "e", " ", "C", " ", "compiler", " ", "found", " ", "(", "distutils", " ", "mode", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "setup", "\\u", "compiler_", "(_", "ctx_", ",_", "yak", "u\\u", "cc", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cxx", "\\u", "exec_", "=_", "get", "\\u", "distutils", "\\u", "cxx", "\\u", "exec_", "(_", "ctx_", ",_", "compiler", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yak", "u\\u", "cxx", "\\u", "type_", "=_", "detect", "\\u", "cxx", "\\u", "type_", "(_", "ctx_", ",_", "cxx", "\\u", "exec_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "yak", "u\\u", "cxx", "\\u", "type_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "No", " ", "ade", "quat", "e", " ", "CXX", " ", "compiler", " ", "found", " ", "(", "distutils", " ", "mode", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "setup", "\\u", "cxx", "compiler_", "(_", "ctx_", ",_", "yak", "u\\u", "cxx", "\\u", "type_", ")_", "\\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 ", " _", "dist", "\\u", "env_", "=_", "setup", "\\u", "pye", "xt\\u", "env_", "(_", "ctx_", ",_", "compiler", "\\u", "type_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "._", "update_", "(_", "dist", "\\u", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "setup", "\\u", "compiler_", "(_", "ctx_", ",_", "compiler", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pyco", "de_", "=_", "r", "\"\"\"", "\\\\", "\\", "10", ";", "#", "include", " ", "<", "Pyth", "on", ".", "h", ">", "\\", "10", ";", "#", "include", " ", "<", "std", "io", ".", "h", ">", "\\", "10", ";", "\\", "10", ";", "static", " ", "Py", "Object", "*", "\\", "10", ";", "hell", "o", "(", "Py", "Object", " ", "*", "self", ",", " ", "Py", "Object", " ", "*", "args", ")", "\\", "10", ";", "{", "\\", "10", ";", " ", " ", " ", " ", "printf", "(\"", "Hell", "o", " ", "from", " ", "C", "\\\\", "n", "\");", "\\", "10", ";", " ", " ", " ", " ", "Py", "\\u", "INC", "REF", "(", "Py", "\\u", "Non", "e", ");", "\\", "10", ";", " ", " ", " ", " ", "return", " ", "Py", "\\u", "Non", "e", ";", "\\", "10", ";}", "\\", "10", ";", "\\", "10", ";", "static", " ", "Py", "Meth", "od", "Def", " ", "Hell", "o", "Meth", "ods", "[]", " ", "=", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "{", "\"", "hell", "o", "\",", " ", " ", "hell", "o", ",", " ", "METH", "\\u", "VAR", "ARG", "S", ",", " ", "\"", "Print", " ", "a", " ", "hell", "o", " ", "world", ".\"", "},", "\\", "10", ";", " ", " ", " ", " ", "{", "NULL", ",", " ", "NULL", ",", " ", "0", ",", " ", "NULL", "}", " ", " ", " ", " ", "/*", " ", "Senti", "nel", " ", "*/", "\\", "10", ";}", ";", "\\", "10", ";", "\\", "10", ";", "Py", "MODI", "NIT", "\\u", "FUNC", "\\", "10", ";", "init", "\\u", "bar", "(", "voi", "d", ")", "\\", "10", ";", "{", "\\", "10", ";", " ", " ", " ", " ", "(", "voi", "d", ")", " ", "Py", "\\u", "Ini", "t", "Modul", "e", "(\"", "\\u", "bar", "\",", " ", "Hell", "o", "Meth", "ods", ");", "\\", "10", ";}", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "start", "\\u", "message_", "(_", "\"", "Check", "ing", " ", "whe", "ther", " ", "%", "s", " ", "can", " ", "build", " ", "python", " ", "object", " ", "code", "\"_", "%_", "compiler", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "try", "\\u", "compile_", "(_", "\"", "foo", "\"_", ",_", "pyco", "de_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "end", "\\u", "message_", "(_", "\"", "ye", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Task", "Run", "Failure_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "=_", "get", "\\u", "exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "end", "\\u", "message_", "(_", "\"", "no", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "fail", "\\u", "configuration_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctx_", "._", "start", "\\u", "message_", "(_", "\"", "Check", "ing", " ", "whe", "ther", " ", "%", "s", " ", "can", " ", "build", " ", "python", " ", "extensi", "on", "\"_", "%_", "compiler", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "try", "\\u", "extension_", "(_", "\"", "foo", "\"_", ",_", "pyco", "de_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "end", "\\u", "message_", "(_", "\"", "ye", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Task", "Run", "Failure_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "=_", "get", "\\u", "exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "end", "\\u", "message_", "(_", "\"", "no", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "fail", "\\u", "configuration_", "(_", "str_", "(_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "configured_", "=_", "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_", "def_", "get", "\\u", "builder_", "(_", "ctx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Pyth", "on", "Builder_", "(_", "ctx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "detect", "\\u", "cc", "\\u", "type_", "(_", "ctx_", ",_", "cc", "\\u", "cmd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u", "detect", "\\u", "cc", "\\u", "type_", "(_", "ctx_", ",_", "cc", "\\u", "cmd_", ")_", "\\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_", "detect", "\\u", "cxx", "\\u", "type_", "(_", "ctx_", ",_", "cxx", "\\u", "cmd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cxx", "\\u", "type_", "=_", "\\u", "detect", "\\u", "cc", "\\u", "type_", "(_", "ctx_", ",_", "cxx", "\\u", "cmd_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cxx", "\\u", "type_", "==_", "\"", "gcc", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"", "gx", "x", "\"_", "\\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_", "cxx", "\\u", "type_", "\\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", "detect", "\\u", "cc", "\\u", "type_", "(_", "ctx_", ",_", "cc", "\\u", "cmd_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cc", "\\u", "type_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "detect", "\\u", "type_", "(_", "vf", "lag_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "cc", "\\u", "cmd_", "+_", "[_", "vf", "lag_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "=_", "os_", "._", "environ_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "[_", "\"", "LC", "\\u", "ALL", "\"_", "]_", "=_", "env_", "[_", "\"", "LANGUAGE", "\"_", "]_", "=_", "\"", "C", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "p_", "=_", "Popen_", "(_", "cmd_", ",_", "stdout_", "=_", "PIPE_", ",_", "stderr_", "=_", "STDOUT_", ",_", "env_", "=_", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "=_", "p_", "._", "communicate_", "(_", ")_", "[_", "0_", "]_", "._", "decode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "CC", "\\u", "SIGNATURE", "_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m_", "=_", "v_", "._", "search_", "(_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "m_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "k_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "OUTPUT_", "._", "write_", "(_", "\"", "Detect", "ing", " ", "CC", " ", "type", "...", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sys_", "._", "platform_", "==_", "\"", "win32", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "v_", "in_", "[_", "\"\"_", ",_", "\"-", "v", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cc", "\\u", "type_", "=_", "detect", "\\u", "type_", "(_", "v_", ")_", "\\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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "v_", "in_", "[_", "\"-", "v", "\"_", ",_", "\"-", "V", "\"_", ",_", "\"-", "###", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cc", "\\u", "type_", "=_", "detect", "\\u", "type_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cc", "\\u", "type_", ":_", "\\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_", "if_", "cc", "\\u", "type_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cc", "\\u", "type_", "=_", "\"", "cc", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "OSE", "rror_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "e_", "=_", "extract", "\\u", "exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "e_", "._", "errno_", "==_", "errno_", "._", "ENOENT_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "compiler", " ", "%", "r", " ", "not", " ", "found", "\"_", "%_", "\"", " ", "\"_", "._", "join_", "(_", "cc", "\\u", "cmd_", ")_", ")_", "\\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_", "(_", "\"", "Une", "xpe", "cte", "d", " ", "error", " ", "%", "r", " ", "whe", "n", " ", "testi", "ng", " ", "compiler", " ", "%", "r", "\"_", "%_", "(_", "e_", ",_", "cc", "\\u", "cmd_", ")_", ")_", "\\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", "OUTPUT_", "._", "write_", "(_", "\"%", "s", "\\\\", "n", "\"_", "%_", "cc", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cc", "\\u", "type_", "\\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", "distutils", "\\u", "cc", "\\u", "exec_", "(_", "ctx_", ",_", "compiler", "\\u", "type_", "=_", "\"", "default", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "distutils_", "import_", "cco", "mpi", "ler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "distutils_", "._", "sysconfig", "_", "import_", "customize", "\\u", "compiler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "OUTPUT_", "._", "write_", "(_", "\"", "Detect", "ing", " ", "distutils", " ", "CC", " ", "exec", " ", "...", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "compiler", "\\u", "type_", "==_", "\"", "default", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "compiler", "\\u", "type_", "=_", "distutils_", "._", "cco", "mpi", "ler_", "._", "get", "\\u", "default", "\\u", "compiler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "compiler_", "=_", "cco", "mpi", "ler_", "._", "new", "\\u", "compiler_", "(_", "compiler_", "=_", "compiler", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "customize", "\\u", "compiler_", "(_", "compiler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "compiler", "\\u", "type_", "==_", "\"", "msvc", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "compiler_", "._", "initialize_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cc_", "=_", "[_", "compiler_", "._", "cc_", "]_", "\\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 ", " _", "cc_", "=_", "compiler_", "._", "compiler", "\\u", "so_", "[_", ":_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "OUTPUT_", "._", "write_", "(_", "\"%", "s", "\\\\", "n", "\"_", "%_", "\"", " ", "\"_", "._", "join_", "(_", "cc_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cc_", "\\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", "distutils", "\\u", "cxx", "\\u", "exec_", "(_", "ctx_", ",_", "compiler", "\\u", "type_", "=_", "\"", "default", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "distutils_", "import_", "cco", "mpi", "ler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "distutils_", "._", "sysconfig", "_", "import_", "customize", "\\u", "compiler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "OUTPUT_", "._", "write_", "(_", "\"", "Detect", "ing", " ", "distutils", " ", "CXX", " ", "exec", " ", "...", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "compiler", "\\u", "type_", "==_", "\"", "default", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "compiler", "\\u", "type_", "=_", "distutils_", "._", "cco", "mpi", "ler_", "._", "get", "\\u", "default", "\\u", "compiler_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "compiler_", "=_", "cco", "mpi", "ler_", "._", "new", "\\u", "compiler_", "(_", "compiler_", "=_", "compiler", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "compiler", "\\u", "type_", "==_", "\"", "msvc", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "compiler_", "._", "initialize_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cc_", "=_", "[_", "compiler_", "._", "cc_", "]_", "\\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 ", " _", "customize", "\\u", "compiler_", "(_", "compiler_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cc_", "=_", "compiler_", "._", "compiler", "\\u", "cxx", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "OUTPUT_", "._", "write_", "(_", "\"%", "s", "\\\\", "n", "\"_", "%_", "\"", " ", "\"_", "._", "join_", "(_", "cc_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cc_", "\\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", "setup", "\\u", "compiler_", "(_", "ctx_", ",_", "cc", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "env_", "=_", "ctx_", "._", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "=_", "Environment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cc", "\\u", "env_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "os_", "._", "path_", "._", "dirname_", "(_", "yak", "u_", "._", "tools_", "._", "\\u\\u", "file\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\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 ", " _", "mod_", "=_", "\\u\\u", "import\\u\\u_", "(_", "cc", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mod_", "._", "setup_", "(_", "ctx_", ")_", "\\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 ", " _", "raise_", "Run", "time", "Error_", "(_", "\"", "No", " ", "tool", " ", "%", "s", " ", "is", " ", "avail", "able", " ", "(", "import", " ", "fail", "ed", ")\"_", "%_", "cc", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", ":", " ", "this", " ", "is", " ", "ug", "ly", " ", "-", " ", "find", " ", "a", " ", "way", " ", "to", " ", "have", " ", "tool", "-", "specific", " ", "env", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cc", "\\u", "env_", "=_", "ctx_", "._", "env_", "\\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 ", " _", "sys_", "._", "path_", "._", "pop_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "=_", "old", "\\u", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "copie", "d\\u", "values_", "=_", "[_", "\"", "CC", "\"_", ",_", "\"", "CPP", "PATH", "\\u", "FMT", "\"_", ",_", "\"", "LIB", "DIR", "\\u", "FMT", "\"_", ",_", "\"", "LIB", "\\u", "FMT", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CC", "\\u", "OBJ", "ECT", "\\u", "FMT", "\"_", ",_", "\"", "CC", "\\u", "TGT", "\\u", "F", "\"_", ",_", "\"", "CC", "\\u", "SR", "C", "\\u", "F", "\"_", ",_", "\"", "LINK", "\\u", "TGT", "\\u", "F", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "LINK", "\\u", "SR", "C", "\\u", "F", "\"_", ",_", "\"", "SH", "LINK", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "k_", "in_", "copie", "d\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "env_", "[_", "\"", "PY", "EXT", "\\u", "%", "s", "\"_", "%_", "k_", "]_", "=_", "cc", "\\u", "env_", "[_", "k_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctx_", "._", "env_", "._", "pre", "xte", "nd_", "(_", "\"", "PY", "EXT", "\\u", "CPP", "PATH", "\"_", ",_", "cc", "\\u", "env_", "[_", "\"", "CPP", "PATH", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "._", "pre", "xte", "nd_", "(_", "\"", "PY", "EXT", "\\u", "LIB", "DIR", "\"_", ",_", "cc", "\\u", "env_", "[_", "\"", "LIB", "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_", "\\u", "setup", "\\u", "cxx", "compiler_", "(_", "ctx_", ",_", "cxx", "\\u", "type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "old", "\\u", "env_", "=_", "ctx_", "._", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "=_", "Environment_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "os_", "._", "path_", "._", "dirname_", "(_", "yak", "u_", "._", "tools_", "._", "\\u\\u", "file\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mod_", "=_", "\\u\\u", "import\\u\\u_", "(_", "cxx", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mod_", "._", "setup_", "(_", "ctx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cxx", "\\u", "env_", "=_", "ctx_", "._", "env_", "\\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 ", " _", "sys_", "._", "path_", "._", "pop_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "=_", "old", "\\u", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "k_", "in_", "[_", "\"", "CXX", "\"_", ",_", "\"", "CXX", "FLAG", "S", "\"_", ",_", "\"", "CXX", "\\u", "TGT", "\\u", "F", "\"_", ",_", "\"", "CXX", "\\u", "SR", "C", "\\u", "F", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "CXX", "SH", "LINK", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "env_", "[_", "\"", "PY", "EXT", "\\u", "%", "s", "\"_", "%_", "k_", "]_", "=_", "cxx", "\\u", "env_", "[_", "k_", "]_", "\\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_", "appl", "y", "\\u", "frameworks", "_", "(_", "task", "\\u", "gen_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "XX", "X", ":", " ", "do", " ", "this", " ", "correct", "ly", " ", "(", "platform", " ", "specific", " ", "tool", " ", "config", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "sys_", "._", "platform_", "==_", "\"", "dar", "win", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "frameworks", "_", "=_", "task", "\\u", "gen_", "._", "env_", "._", "get_", "(_", "\"", "PY", "EXT", "\\u", "FRAME", "WORKS", "\"_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task", "\\u", "gen_", "._", "env_", "[_", "\"", "PY", "EXT", "\\u", "APP", "\\u", "FRAME", "WORKS", "\"_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "framework_", "in_", "frameworks", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "task", "\\u", "gen_", "._", "env_", "[_", "\"", "PY", "EXT", "\\u", "APP", "\\u", "FRAME", "WORKS", "\"_", "]_", "._", "extend_", "(_", "[_", "\"-", "frame", "work", "\"_", ",_", "framework_", "]_", ")_", "\\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 ", " _", "task", "\\u", "gen_", "._", "env_", "[_", "\"", "PY", "EXT", "\\u", "APP", "\\u", "FRAME", "WORKS", "\"_", "]_", "=_", "[_", "]_", "\\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_", "appl", "y", "\\u", "libs_", "(_", "task", "\\u", "gen_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "libs_", "=_", "task", "\\u", "gen_", "._", "env_", "[_", "\"", "PY", "EXT", "\\u", "LIBS", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task", "\\u", "gen_", "._", "env_", "[_", "\"", "PY", "EXT", "\\u", "APP", "\\u", "LIBS", "\"_", "]_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "task", "\\u", "gen_", "._", "env_", "[_", "\"", "PY", "EXT", "\\u", "LIB", "\\u", "FMT", "\"_", "]_", "%_", "lib_", "for_", "lib_", "in_", "libs_", "]_", "\\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_", "appl", "y", "\\u", "libpa", "th_", "(_", "task", "\\u", "gen_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "libdir", "_", "=_", "task", "\\u", "gen_", "._", "env_", "[_", "\"", "PY", "EXT", "\\u", "LIB", "DIR", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "implicit", "\\u", "path", "s", " ", "=", " ", "set", "([", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "os", ".", "path", ".", "join", "(", "task", "\\u", "gen", ".", "env", "[\"", "BL", "DD", "IR", "\"]", ",", " ", "os", ".", "path", ".", "dir", "name", "(", "s", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "for", " ", "s", " ", "in", " ", "task", "\\u", "gen", ".", "source", "s", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "implicit", "\\u", "paths_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "libdir", "_", "=_", "list_", "(_", "implicit", "\\u", "paths_", ")_", "+_", "libdir", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task", "\\u", "gen_", "._", "env_", "[_", "\"", "PY", "EXT", "\\u", "APP", "\\u", "LIB", "DIR", "\"_", "]_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "task", "\\u", "gen_", "._", "env_", "[_", "\"", "PY", "EXT", "\\u", "LIB", "DIR", "\\u", "FMT", "\"_", "]_", "%_", "d_", "for_", "d_", "in_", "libdir", "_", "]_", "\\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_", "appl", "y", "\\u", "cpp", "path_", "(_", "task", "\\u", "gen_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cpp", "paths_", "=_", "task", "\\u", "gen_", "._", "env_", "[_", "\"", "PY", "EXT", "\\u", "CPP", "PATH", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "implicit", "\\u", "paths_", "=_", "set_", "(_", "[_", "s_", "._", "parent_", "._", "srcp", "ath_", "(_", ")_", "for_", "s_", "in_", "task", "\\u", "gen_", "._", "sources_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "src", "node_", "=_", "task", "\\u", "gen_", "._", "sources_", "[_", "0_", "]_", "._", "ctx_", "._", "src", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rel", "cpp", "paths_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "cpp", "paths_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "os_", "._", "path_", "._", "isabs_", "(_", "p_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "=_", "src", "node_", "._", "find", "\\u", "node_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "node_", "is_", "not_", "None_", ",_", "\"", "coul", "d", " ", "not", " ", "find", " ", "%", "s", "\"_", "%_", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rel", "cpp", "paths_", "._", "append_", "(_", "node_", "._", "bld", "path_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rel", "cpp", "paths_", "._", "append_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cpp", "paths_", "=_", "list_", "(_", "implicit", "\\u", "paths_", ")_", "+_", "rel", "cpp", "paths_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task", "\\u", "gen_", "._", "env_", "[_", "\"", "PY", "EXT", "\\u", "INC", "PATH", "\"_", "]_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "task", "\\u", "gen_", "._", "env_", "[_", "\"", "PY", "EXT", "\\u", "CPP", "PATH", "\\u", "FMT", "\"_", "]_", "%_", "p_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "p_", "in_", "cpp", "paths_", "]_" ]
[ 4, 4, 4, 4, 4, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1,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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
babble/babble/include/jython/Lib/test/test_tarfile.py
[ { "content": " def test_seek(self):\n \"\"\"Test seek() method of _FileObject, incl. random reading.\n \"\"\"\n if self.sep != \"|\":\n filename = \"0-REGTYPE-TEXT\"\n self.tar.extract(filename, dirname())\n f = open(os.path.join(dirname(), filename), \"rb\")\n data = f.read()\n f.close()\n\n tarinfo = self.tar.getmember(filename)\n fobj = self.tar.extractfile(tarinfo)\n\n text = fobj.read()\n fobj.seek(0)\n self.assert_(0 == fobj.tell(),\n \"seek() to file's start failed\")\n fobj.seek(2048, 0)\n self.assert_(2048 == fobj.tell(),\n \"seek() to absolute position failed\")\n fobj.seek(-1024, 1)\n self.assert_(1024 == fobj.tell(),\n \"seek() to negative relative position failed\")\n fobj.seek(1024, 1)\n self.assert_(2048 == fobj.tell(),\n \"seek() to positive relative position failed\")\n s = fobj.read(10)\n self.assert_(s == data[2048:2058],\n \"read() after seek failed\")\n fobj.seek(0, 2)\n self.assert_(tarinfo.size == fobj.tell(),\n \"seek() to file's end failed\")\n self.assert_(fobj.read() == \"\",\n \"read() at file's end did not return empty string\")\n fobj.seek(-tarinfo.size, 2)\n self.assert_(0 == fobj.tell(),\n \"relative seek() to file's start failed\")\n fobj.seek(512)\n s1 = fobj.readlines()\n fobj.seek(512)\n s2 = fobj.readlines()\n self.assert_(s1 == s2,\n \"readlines() after seek failed\")\n fobj.seek(0)\n self.assert_(len(fobj.readline()) == fobj.tell(),\n \"tell() after readline() failed\")\n fobj.seek(512)\n self.assert_(len(fobj.readline()) + 512 == fobj.tell(),\n \"tell() after seek() and readline() failed\")\n fobj.seek(0)\n line = fobj.readline()\n self.assert_(fobj.read() == data[len(line):],\n \"read() after readline() failed\")\n fobj.close()", "metadata": "root.ReadTest.test_seek", "header": "['class', 'ReadTest', '(', 'BaseTest', ')', ':', '___EOS___']", "index": 111 } ]
[ { "span": "text ", "start_line": 124, "start_column": 12, "end_line": 124, "end_column": 16 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Read", "Test_", "(_", "Base", "Test_", ")_", ":_", "\\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", "seek_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Test", " ", "seek", "()", " ", "method", " ", "of", " ", "\\u", "File", "Object", ",", " ", "incl", ".", " ", "random", " ", "readi", "ng", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "sep_", "!=_", "\"|\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "\"", "0", "-", "REG", "TYPE", "-", "TEXT", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "tar_", "._", "extract_", "(_", "filename_", ",_", "dirname_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "dirname_", "(_", ")_", ",_", "filename_", ")_", ",_", "\"", "rb", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "f_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tari", "nfo_", "=_", "self_", "._", "tar_", "._", "getmember", "_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fobj_", "=_", "self_", "._", "tar_", "._", "extract", "file_", "(_", "tari", "nfo_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "text_", "=_", "fobj_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fobj_", "._", "seek_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "0_", "==_", "fobj_", "._", "tell_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "seek", "()", " ", "to", " ", "file", "'", "s", " ", "start", " ", "fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fobj_", "._", "seek_", "(_", "2048_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "2048_", "==_", "fobj_", "._", "tell_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "seek", "()", " ", "to", " ", "abs", "olute", " ", "position", " ", "fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fobj_", "._", "seek_", "(_", "-_", "1024_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "1024_", "==_", "fobj_", "._", "tell_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "seek", "()", " ", "to", " ", "negati", "ve", " ", "relative", " ", "position", " ", "fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fobj_", "._", "seek_", "(_", "1024_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "2048_", "==_", "fobj_", "._", "tell_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "seek", "()", " ", "to", " ", "posit", "ive", " ", "relative", " ", "position", " ", "fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "fobj_", "._", "read_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "s_", "==_", "data_", "[_", "2048_", ":_", "205", "8_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "read", "()", " ", "after", " ", "seek", " ", "fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fobj_", "._", "seek_", "(_", "0_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "tari", "nfo_", "._", "size_", "==_", "fobj_", "._", "tell_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "seek", "()", " ", "to", " ", "file", "'", "s", " ", "end", " ", "fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "fobj_", "._", "read_", "(_", ")_", "==_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "read", "()", " ", "at", " ", "file", "'", "s", " ", "end", " ", "did", " ", "not", " ", "return", " ", "empty", " ", "string", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fobj_", "._", "seek_", "(_", "-_", "tari", "nfo_", "._", "size_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "0_", "==_", "fobj_", "._", "tell_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "relative", " ", "seek", "()", " ", "to", " ", "file", "'", "s", " ", "start", " ", "fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fobj_", "._", "seek_", "(_", "512_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s1_", "=_", "fobj_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fobj_", "._", "seek_", "(_", "512_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s2_", "=_", "fobj_", "._", "readlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "s1_", "==_", "s2_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "readline", "s", "()", " ", "after", " ", "seek", " ", "fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fobj_", "._", "seek_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "len_", "(_", "fobj_", "._", "readline_", "(_", ")_", ")_", "==_", "fobj_", "._", "tell_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tell", "()", " ", "after", " ", "readline", "()", " ", "fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fobj_", "._", "seek_", "(_", "512_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "len_", "(_", "fobj_", "._", "readline_", "(_", ")_", ")_", "+_", "512_", "==_", "fobj_", "._", "tell_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "tell", "()", " ", "after", " ", "seek", "()", " ", "and", " ", "readline", "()", " ", "fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fobj_", "._", "seek_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "fobj_", "._", "readline_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert\\u_", "(_", "fobj_", "._", "read_", "(_", ")_", "==_", "data_", "[_", "len_", "(_", "line_", ")_", ":_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "read", "()", " ", "after", " ", "readline", "()", " ", "fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fobj_", "._", "close_", "(_", ")_", "\\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, 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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 ]
Comparison of constants
babble/babble/include/jython/Lib/test/test_bool.py
[ { "content": " def test_math(self):\n self.assertEqual(+False, 0)\n self.assertIsNot(+False, False)\n self.assertEqual(-False, 0)\n self.assertIsNot(-False, False)\n self.assertEqual(abs(False), 0)\n self.assertIsNot(abs(False), False)\n self.assertEqual(+True, 1)\n self.assertIsNot(+True, True)\n self.assertEqual(-True, -1)\n self.assertEqual(abs(True), 1)\n self.assertIsNot(abs(True), True)\n self.assertEqual(~False, -1)\n self.assertEqual(~True, -2)\n\n self.assertEqual(False+2, 2)\n self.assertEqual(True+2, 3)\n self.assertEqual(2+False, 2)\n self.assertEqual(2+True, 3)\n\n self.assertEqual(False+False, 0)\n self.assertIsNot(False+False, False)\n self.assertEqual(False+True, 1)\n self.assertIsNot(False+True, True)\n self.assertEqual(True+False, 1)\n self.assertIsNot(True+False, True)\n self.assertEqual(True+True, 2)\n\n self.assertEqual(True-True, 0)\n self.assertIsNot(True-True, False)\n self.assertEqual(False-False, 0)\n self.assertIsNot(False-False, False)\n self.assertEqual(True-False, 1)\n self.assertIsNot(True-False, True)\n self.assertEqual(False-True, -1)\n\n self.assertEqual(True*1, 1)\n self.assertEqual(False*1, 0)\n self.assertIsNot(False*1, False)\n\n self.assertEqual(True/1, 1)\n self.assertIsNot(True/1, True)\n self.assertEqual(False/1, 0)\n self.assertIsNot(False/1, False)\n\n for b in False, True:\n for i in 0, 1, 2:\n self.assertEqual(b**i, int(b)**i)\n self.assertIsNot(b**i, bool(int(b)**i))\n\n for a in False, True:\n for b in False, True:\n self.assertIs(a&b, bool(int(a)&int(b)))\n self.assertIs(a|b, bool(int(a)|int(b)))\n self.assertIs(a^b, bool(int(a)^int(b)))\n self.assertEqual(a&int(b), int(a)&int(b))\n self.assertIsNot(a&int(b), bool(int(a)&int(b)))\n self.assertEqual(a|int(b), int(a)|int(b))\n self.assertIsNot(a|int(b), bool(int(a)|int(b)))\n self.assertEqual(a^int(b), int(a)^int(b))\n self.assertIsNot(a^int(b), bool(int(a)^int(b)))\n self.assertEqual(int(a)&b, int(a)&int(b))\n self.assertIsNot(int(a)&b, bool(int(a)&int(b)))\n self.assertEqual(int(a)|b, int(a)|int(b))\n self.assertIsNot(int(a)|b, bool(int(a)|int(b)))\n self.assertEqual(int(a)^b, int(a)^int(b))\n self.assertIsNot(int(a)^b, bool(int(a)^int(b)))\n\n self.assertIs(1==1, True)\n self.assertIs(1==0, False)\n self.assertIs(0<1, True)\n self.assertIs(1<0, False)\n self.assertIs(0<=0, True)\n self.assertIs(1<=0, False)\n self.assertIs(1>0, True)\n self.assertIs(1>1, False)\n self.assertIs(1>=1, True)\n self.assertIs(0>=1, False)\n self.assertIs(0!=1, True)\n self.assertIs(0!=0, False)\n\n x = [1]\n self.assertIs(x is x, True)\n self.assertIs(x is not x, False)\n\n self.assertIs(1 in x, True)\n self.assertIs(0 in x, False)\n self.assertIs(1 not in x, False)\n self.assertIs(0 not in x, True)\n\n x = {1: 2}\n self.assertIs(x is x, True)\n self.assertIs(x is not x, False)\n\n self.assertIs(1 in x, True)\n self.assertIs(0 in x, False)\n self.assertIs(1 not in x, False)\n self.assertIs(0 not in x, True)\n\n self.assertIs(not True, False)\n self.assertIs(not False, True)", "metadata": "root.BoolTest.test_math", "header": "['class', 'BoolTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 53 } ]
[ { "span": "1==1,", "start_line": 121, "start_column": 22, "end_line": 121, "end_column": 26 }, { "span": "1==0,", "start_line": 122, "start_column": 22, "end_line": 122, "end_column": 26 }, { "span": "0<1,", "start_line": 123, "start_column": 22, "end_line": 123, "end_column": 25 }, { "span": "1<0,", "start_line": 124, "start_column": 22, "end_line": 124, "end_column": 25 }, { "span": "0<=0,", "start_line": 125, "start_column": 22, "end_line": 125, "end_column": 26 }, { "span": "1<=0,", "start_line": 126, "start_column": 22, "end_line": 126, "end_column": 26 }, { "span": "1>0,", "start_line": 127, "start_column": 22, "end_line": 127, "end_column": 25 }, { "span": "1>1,", "start_line": 128, "start_column": 22, "end_line": 128, "end_column": 25 }, { "span": "1>=1,", "start_line": 129, "start_column": 22, "end_line": 129, "end_column": 26 }, { "span": "0>=1,", "start_line": 130, "start_column": 22, "end_line": 130, "end_column": 26 }, { "span": "0!=1,", "start_line": 131, "start_column": 22, "end_line": 131, "end_column": 26 }, { "span": "0!=0,", "start_line": 132, "start_column": 22, "end_line": 132, "end_column": 26 } ]
[]
1
true
[ "[CLS]_", "Compari", "son_", "of_", "constants_", "[SEP]_", "class_", "Boo", "l", "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", "math_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "+_", "False_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "+_", "False_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "-_", "False_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "-_", "False_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "abs_", "(_", "False_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "abs_", "(_", "False_", ")_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "+_", "True_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "+_", "True_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "-_", "True_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "abs_", "(_", "True_", ")_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "abs_", "(_", "True_", ")_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "~_", "False_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "~_", "True_", ",_", "-_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "False_", "+_", "2_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "True_", "+_", "2_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "2_", "+_", "False_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "2_", "+_", "True_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "False_", "+_", "False_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "False_", "+_", "False_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "False_", "+_", "True_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "False_", "+_", "True_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "True_", "+_", "False_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "True_", "+_", "False_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "True_", "+_", "True_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "True_", "-_", "True_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "True_", "-_", "True_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "False_", "-_", "False_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "False_", "-_", "False_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "True_", "-_", "False_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "True_", "-_", "False_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "False_", "-_", "True_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "True_", "*_", "1_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "False_", "*_", "1_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "False_", "*_", "1_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "True_", "/_", "1_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "True_", "/_", "1_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "False_", "/_", "1_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "False_", "/_", "1_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "b_", "in_", "False_", ",_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", "in_", "0_", ",_", "1_", ",_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "b_", "**_", "i_", ",_", "int_", "(_", "b_", ")_", "**_", "i_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "b_", "**_", "i_", ",_", "bool_", "(_", "int_", "(_", "b_", ")_", "**_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "a_", "in_", "False_", ",_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "b_", "in_", "False_", ",_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Is_", "(_", "a_", "&_", "b_", ",_", "bool_", "(_", "int_", "(_", "a_", ")_", "&_", "int_", "(_", "b_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "a_", "|_", "b_", ",_", "bool_", "(_", "int_", "(_", "a_", ")_", "|_", "int_", "(_", "b_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "a_", "^_", "b_", ",_", "bool_", "(_", "int_", "(_", "a_", ")_", "^_", "int_", "(_", "b_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a_", "&_", "int_", "(_", "b_", ")_", ",_", "int_", "(_", "a_", ")_", "&_", "int_", "(_", "b_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "a_", "&_", "int_", "(_", "b_", ")_", ",_", "bool_", "(_", "int_", "(_", "a_", ")_", "&_", "int_", "(_", "b_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a_", "|_", "int_", "(_", "b_", ")_", ",_", "int_", "(_", "a_", ")_", "|_", "int_", "(_", "b_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "a_", "|_", "int_", "(_", "b_", ")_", ",_", "bool_", "(_", "int_", "(_", "a_", ")_", "|_", "int_", "(_", "b_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "a_", "^_", "int_", "(_", "b_", ")_", ",_", "int_", "(_", "a_", ")_", "^_", "int_", "(_", "b_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "a_", "^_", "int_", "(_", "b_", ")_", ",_", "bool_", "(_", "int_", "(_", "a_", ")_", "^_", "int_", "(_", "b_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "int_", "(_", "a_", ")_", "&_", "b_", ",_", "int_", "(_", "a_", ")_", "&_", "int_", "(_", "b_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "int_", "(_", "a_", ")_", "&_", "b_", ",_", "bool_", "(_", "int_", "(_", "a_", ")_", "&_", "int_", "(_", "b_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "int_", "(_", "a_", ")_", "|_", "b_", ",_", "int_", "(_", "a_", ")_", "|_", "int_", "(_", "b_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "int_", "(_", "a_", ")_", "|_", "b_", ",_", "bool_", "(_", "int_", "(_", "a_", ")_", "|_", "int_", "(_", "b_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "int_", "(_", "a_", ")_", "^_", "b_", ",_", "int_", "(_", "a_", ")_", "^_", "int_", "(_", "b_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is", "Not_", "(_", "int_", "(_", "a_", ")_", "^_", "b_", ",_", "bool_", "(_", "int_", "(_", "a_", ")_", "^_", "int_", "(_", "b_", ")_", ")_", ")_", "\\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", "Is_", "(_", "1_", "==_", "1_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "1_", "==_", "0_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "0_", "<_", "1_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "1_", "<_", "0_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "0_", "<=_", "0_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "1_", "<=_", "0_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "1_", ">_", "0_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "1_", ">_", "1_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "1_", ">=_", "1_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "0_", ">=_", "1_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "0_", "!=_", "1_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "0_", "!=_", "0_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "=_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", "is_", "x_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", "is_", "not_", "x_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "1_", "in_", "x_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "0_", "in_", "x_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "1_", "not_", "in_", "x_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "0_", "not_", "in_", "x_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "=_", "{_", "1_", ":_", "2_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", "is_", "x_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "x_", "is_", "not_", "x_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "1_", "in_", "x_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "0_", "in_", "x_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "1_", "not_", "in_", "x_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "0_", "not_", "in_", "x_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "not_", "True_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Is_", "(_", "not_", "False_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Unused import
ImageEngine/gaffer/python/GafferImageUI/__init__.py
[ { "content": "##########################################################################\n#\n# Copyright (c) 2012, John Haddon. All rights reserved.\n# Copyright (c) 2012-2015, Image Engine Design Inc. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n#\n# * Redistributions of source code must retain the above\n# copyright notice, this list of conditions and the following\n# disclaimer.\n#\n# * Redistributions in binary form must reproduce the above\n# copyright notice, this list of conditions and the following\n# disclaimer in the documentation and/or other materials provided with\n# the distribution.\n#\n# * Neither the name of John Haddon nor the names of\n# any other contributors to this software may be used to endorse or\n# promote products derived from this software without specific prior\n# written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\n# IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\n# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n# 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#\n##########################################################################\n\nfrom _GafferImageUI import *\n\nimport DisplayUI\nfrom FormatPlugValueWidget import FormatPlugValueWidget\nfrom ChannelMaskPlugValueWidget import ChannelMaskPlugValueWidget\n\nimport OpenImageIOReaderUI\nimport ImageReaderUI\nimport ImageViewToolbar\nimport ImageTransformUI\nimport ConstantUI\nimport ImageSwitchUI\nimport ColorSpaceUI\nimport ImageContextVariablesUI\nimport ImageStatsUI\nimport DeleteChannelsUI\nimport ObjectToImageUI\nimport ClampUI\nimport ImageWriterUI\nimport GradeUI\nimport ImageTimeWarpUI\nimport ImageSamplerUI\nimport MergeUI\nimport ImageNodeUI\nimport ChannelDataProcessorUI\nimport ImageProcessorUI\nimport ImageMetadataUI\nimport DeleteImageMetadataUI\nimport CopyImageMetadataUI\nimport ImageLoopUI\nimport ShuffleUI\nimport PremultiplyUI\nimport UnpremultiplyUI\nimport CropUI\nimport ResizeUI\nimport ResampleUI\nimport LUTUI\nimport CDLUI\nimport DisplayTransformUI\nimport OffsetUI\nimport BlurUI\nimport ShapeUI\nimport TextUI\nimport WarpUI\nimport UVWarpUI\n\n__import__( \"IECore\" ).loadConfig( \"GAFFER_STARTUP_PATHS\", {}, subdirectory = \"GafferImageUI\" )\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import DisplayUI", "start_line": 39, "start_column": 0, "end_line": 39, "end_column": 16 }, { "span": "from FormatPlugValueWidget import FormatPlugValueWidget", "start_line": 40, "start_column": 0, "end_line": 40, "end_column": 55 }, { "span": "from ChannelMaskPlugValueWidget import ChannelMaskPlugValueWidget", "start_line": 41, "start_column": 0, "end_line": 41, "end_column": 65 }, { "span": "import OpenImageIOReaderUI", "start_line": 43, "start_column": 0, "end_line": 43, "end_column": 26 }, { "span": "import ImageReaderUI", "start_line": 44, "start_column": 0, "end_line": 44, "end_column": 20 }, { "span": "import ImageViewToolbar", "start_line": 45, "start_column": 0, "end_line": 45, "end_column": 23 }, { "span": "import ImageTransformUI", "start_line": 46, "start_column": 0, "end_line": 46, "end_column": 23 }, { "span": "import ConstantUI", "start_line": 47, "start_column": 0, "end_line": 47, "end_column": 17 }, { "span": "import ImageSwitchUI", "start_line": 48, "start_column": 0, "end_line": 48, "end_column": 20 }, { "span": "import ColorSpaceUI", "start_line": 49, "start_column": 0, "end_line": 49, "end_column": 19 }, { "span": "import ImageContextVariablesUI", "start_line": 50, "start_column": 0, "end_line": 50, "end_column": 30 }, { "span": "import ImageStatsUI", "start_line": 51, "start_column": 0, "end_line": 51, "end_column": 19 }, { "span": "import DeleteChannelsUI", "start_line": 52, "start_column": 0, "end_line": 52, "end_column": 23 }, { "span": "import ObjectToImageUI", "start_line": 53, "start_column": 0, "end_line": 53, "end_column": 22 }, { "span": "import ClampUI", "start_line": 54, "start_column": 0, "end_line": 54, "end_column": 14 }, { "span": "import ImageWriterUI", "start_line": 55, "start_column": 0, "end_line": 55, "end_column": 20 }, { "span": "import GradeUI", "start_line": 56, "start_column": 0, "end_line": 56, "end_column": 14 }, { "span": "import ImageTimeWarpUI", "start_line": 57, "start_column": 0, "end_line": 57, "end_column": 22 }, { "span": "import ImageSamplerUI", "start_line": 58, "start_column": 0, "end_line": 58, "end_column": 21 }, { "span": "import MergeUI", "start_line": 59, "start_column": 0, "end_line": 59, "end_column": 14 }, { "span": "import ImageNodeUI", "start_line": 60, "start_column": 0, "end_line": 60, "end_column": 18 }, { "span": "import ChannelDataProcessorUI", "start_line": 61, "start_column": 0, "end_line": 61, "end_column": 29 }, { "span": "import ImageProcessorUI", "start_line": 62, "start_column": 0, "end_line": 62, "end_column": 23 }, { "span": "import ImageMetadataUI", "start_line": 63, "start_column": 0, "end_line": 63, "end_column": 22 }, { "span": "import DeleteImageMetadataUI", "start_line": 64, "start_column": 0, "end_line": 64, "end_column": 28 }, { "span": "import CopyImageMetadataUI", "start_line": 65, "start_column": 0, "end_line": 65, "end_column": 26 }, { "span": "import ImageLoopUI", "start_line": 66, "start_column": 0, "end_line": 66, "end_column": 18 }, { "span": "import ShuffleUI", "start_line": 67, "start_column": 0, "end_line": 67, "end_column": 16 }, { "span": "import PremultiplyUI", "start_line": 68, "start_column": 0, "end_line": 68, "end_column": 20 }, { "span": "import UnpremultiplyUI", "start_line": 69, "start_column": 0, "end_line": 69, "end_column": 22 }, { "span": "import CropUI", "start_line": 70, "start_column": 0, "end_line": 70, "end_column": 13 }, { "span": "import ResizeUI", "start_line": 71, "start_column": 0, "end_line": 71, "end_column": 15 }, { "span": "import ResampleUI", "start_line": 72, "start_column": 0, "end_line": 72, "end_column": 17 }, { "span": "import LUTUI", "start_line": 73, "start_column": 0, "end_line": 73, "end_column": 12 }, { "span": "import CDLUI", "start_line": 74, "start_column": 0, "end_line": 74, "end_column": 12 }, { "span": "import DisplayTransformUI", "start_line": 75, "start_column": 0, "end_line": 75, "end_column": 25 }, { "span": "import OffsetUI", "start_line": 76, "start_column": 0, "end_line": 76, "end_column": 15 }, { "span": "import BlurUI", "start_line": 77, "start_column": 0, "end_line": 77, "end_column": 13 }, { "span": "import ShapeUI", "start_line": 78, "start_column": 0, "end_line": 78, "end_column": 14 }, { "span": "import TextUI", "start_line": 79, "start_column": 0, "end_line": 79, "end_column": 13 }, { "span": "import WarpUI", "start_line": 80, "start_column": 0, "end_line": 80, "end_column": 13 }, { "span": "import UVWarpUI", "start_line": 81, "start_column": 0, "end_line": 81, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Copy", "right", " ", "(", "c", ")", " ", "2012", ",", " ", "Joh", "n", " ", "Had", "don", ".", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Copy", "right", " ", "(", "c", ")", " ", "2012", "-", "201", "5", ",", " ", "Image", " ", "Engine", " ", "Desig", "n", " ", "Inc", ".", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Redistributi", "on", " ", "and", " ", "use", " ", "in", " ", "source", " ", "and", " ", "binar", "y", " ", "forms", ",", " ", "with", " ", "or", " ", "with", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "modification", ",", " ", "are", " ", "permit", "ted", " ", "provided", " ", "tha", "t", " ", "the", " ", "follow", "ing", " ", "condition", "s", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "met", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "*", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "copyr", "ight", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "following_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "discl", "aime", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "*", " ", "Redistributi", "ons", " ", "in", " ", "binar", "y", " ", "form", " ", "must", " ", "reproduce", " ", "the", " ", "above_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "copyr", "ight", " ", "notice", ",", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "following_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "discl", "aime", "r", " ", "in", " ", "the", " ", "documentation", " ", "and", "/", "or", " ", "other", " ", "material", "s", " ", "provided", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "the", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "*", " ", "Nei", "ther", " ", "the", " ", "name", " ", "of", " ", "Joh", "n", " ", "Had", "don", " ", "nor", " ", "the", " ", "names", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "any", " ", "other", " ", "contributor", "s", " ", "to", " ", "this", " ", "software", " ", "may", " ", "be", " ", "used", " ", "to", " ", "endo", "rse", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "promote", " ", "products", " ", "derive", "d", " ", "from", " ", "this", " ", "software", " ", "with", "out", " ", "specific", " ", "prior_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "writt", "en", " ", "permissi", "on", "._", "\\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_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "IS", "\"", " ", "AND", " ", "ANY", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "THE", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "PUR", "POS", "E", " ", "ARE", " ", "DISC", "LAI", "MED", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "COPY", "RIG", "HT", " ", "OWNER", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "CONTRIB", "UTO", "RS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "INC", "IDENT", "AL", ",", " ", "SPECIAL", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "EXE", "MPL", "ARY", ",", " ", "OR", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S", " ", "(", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "PROC", "URE", "MENT", " ", "OF", " ", "SUBST", "ITU", "TE", " ", "GOOD", "S", " ", "OR", " ", "SERVICES", ";", " ", "LOSS", " ", "OF", " ", "USE", ",", " ", "DATA", ",", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "PROF", "IT", "S", ";", " ", "OR", " ", "BUS", "INE", "SS", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", " ", "CAU", "SED", " ", "AND", " ", "ON", " ", "ANY", " ", "THE", "ORY", " ", "OF_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "CONTR", "ACT", ",", " ", "STRI", "CT", " ", "LI", "ABI", "LIT", "Y", ",", " ", "OR", " ", "TOR", "T", " ", "(", "INC", "LU", "DING", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "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_", "###########", "###########", "###########", "###########", "###########", "###########", "######", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u", "Ga", "ffer", "Image", "UI_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "Display", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Format", "Plug", "Value", "Widget_", "import_", "Format", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Chan", "nel", "Mask", "Plug", "Value", "Widget_", "import_", "Chan", "nel", "Mask", "Plug", "Value", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "Open", "Image", "IO", "Read", "er", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Image", "Read", "er", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Image", "View", "Toolbar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Image", "Transform", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Const", "ant", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Image", "Switch", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Color", "Spac", "e", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Image", "Context", "Varia", "bles", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Image", "Stat", "s", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Delete", "Chan", "nels", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Object", "To", "Image", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Cla", "mp", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Image", "Write", "r", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Grade", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Image", "Time", "War", "p", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Image", "Sampler", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Merge", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Image", "Node", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Chan", "nel", "Data", "Process", "or", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Image", "Process", "or", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Image", "Meta", "data", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Delete", "Image", "Meta", "data", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Copy", "Image", "Meta", "data", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Image", "Loop", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Shuffle", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Prem", "ulti", "ply", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Unp", "rem", "ulti", "ply", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Cro", "p", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Resize", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Res", "ample", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "LUT", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CD", "LU", "I_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Display", "Transform", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Off", "set", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Blur", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Shape", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "Text", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "War", "p", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "UV", "War", "p", "UI_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "import\\u\\u_", "(_", "\"", "IE", "Core", "\"_", ")_", "._", "load", "Config_", "(_", "\"", "GA", "FFE", "R", "\\u", "START", "UP", "\\u", "PATH", "S", "\"_", ",_", "{_", "}_", ",_", "subdirectory", "_", "=_", "\"", "Ga", "ffer", "Image", "UI", "\"_", ")_" ]
[ 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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, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 2, 0, 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, 2, 0, 1, 1, 2, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 1, 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 ]
Unused import
machinalis/iepy/iepy/webui/corpus/migrations/0006_auto_20140929_1655.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 ('corpus', '0005_auto_20140923_1502'),\n ]\n\n operations = [\n migrations.AlterModelOptions(\n name='iedocument',\n options={'ordering': ['id']},\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_", "(_", "'", "corp", "us", "'_", ",_", "'", "0005", "\\u", "auto", "\\u", "20140", "923", "\\u", "1502", "'_", ")_", ",_", "\\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_", "._", "Alter", "Model", "Options_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "ied", "ocu", "ment", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "=_", "{_", "'", "orderi", "ng", "'_", ":_", "[_", "'", "id", "'_", "]_", "}_", ",_", "\\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 ]
Unused local variable
statsmodels/statsmodels/statsmodels/sandbox/tools/mctools.py
[ { "content": " def histogram(self, idx=None, critval=None):\n '''calculate histogram values\n\n does not do any plotting\n\n I don't remember what I wanted here, looks similar to the new cdf\n method, but this also does a binned pdf (self.histo)\n\n\n '''\n if self.mcres.ndim == 2:\n if not idx is None:\n mcres = self.mcres[:,idx]\n else:\n raise ValueError('currently only 1 statistic at a time')\n else:\n mcres = self.mcres\n\n if critval is None:\n histo = np.histogram(mcres, bins=10)\n else:\n if not critval[0] == -np.inf:\n bins=np.r_[-np.inf, critval, np.inf]\n if not critval[0] == -np.inf:\n bins=np.r_[bins, np.inf]\n histo = np.histogram(mcres,\n bins=np.r_[-np.inf, critval, np.inf])\n\n self.histo = histo\n self.cumhisto = np.cumsum(histo[0])*1./self.nrepl\n self.cumhistoreversed = np.cumsum(histo[0][::-1])[::-1]*1./self.nrepl\n return histo, self.cumhisto, self.cumhistoreversed", "metadata": "root.StatTestMC.histogram", "header": "['class', 'StatTestMC', '(', 'object', ')', ':', '___EOS___']", "index": 163 }, { "content": " def quantiles(self, idx=None, frac=[0.01, 0.025, 0.05, 0.1, 0.975]):\n '''calculate quantiles of Monte Carlo results\n\n similar to ppf\n\n Parameters\n ----------\n idx : None or list of integers\n List of indices into the Monte Carlo results (columns) that should\n be used in the calculation\n frac : array_like, float\n Defines which quantiles should be calculated. For example a frac\n of 0.1 finds the 10% quantile, x such that cdf(x)=0.1\n\n Returns\n -------\n frac : ndarray\n same values as input, TODO: I should drop this again ?\n quantiles : ndarray, (len(frac), len(idx))\n the quantiles with frac in rows and idx variables in columns\n\n Notes\n -----\n\n rename to ppf ? make frac required\n change sequence idx, frac\n\n\n '''\n\n if self.mcres.ndim == 2:\n if not idx is None:\n mcres = self.mcres[:,idx]\n else:\n raise ValueError('currently only 1 statistic at a time')\n else:\n mcres = self.mcres\n\n self.frac = frac = np.asarray(frac)\n\n mc_sorted = self.get_mc_sorted()[:,idx]\n return frac, mc_sorted[(self.nrepl*frac).astype(int)]", "metadata": "root.StatTestMC.quantiles", "header": "['class', 'StatTestMC', '(', 'object', ')', ':', '___EOS___']", "index": 203 }, { "content": " def plot_hist(self, idx, distpdf=None, bins=50, ax=None, kwds=None):\n '''plot the histogram against a reference distribution\n\n Parameters\n ----------\n idx : None or list of integers\n List of indices into the Monte Carlo results (columns) that should\n be used in the calculation\n distpdf : callable\n probability density function of reference distribution\n bins : integer or array_like\n used unchanged for matplotlibs hist call\n ax : TODO: not implemented yet\n kwds : None or tuple of dicts\n extra keyword options to the calls to the matplotlib functions,\n first dictionary is for his, second dictionary for plot of the\n reference distribution\n\n Returns\n -------\n None\n\n\n '''\n if kwds is None:\n kwds = ({},{})\n if self.mcres.ndim == 2:\n if not idx is None:\n mcres = self.mcres[:,idx]\n else:\n raise ValueError('currently only 1 statistic at a time')\n else:\n mcres = self.mcres\n\n lsp = np.linspace(mcres.min(), mcres.max(), 100)\n\n\n import matplotlib.pyplot as plt\n #I don't want to figure this out now\n# if ax=None:\n# fig = plt.figure()\n# ax = fig.addaxis()\n fig = plt.figure()\n plt.hist(mcres, bins=bins, normed=True, **kwds[0])\n plt.plot(lsp, distpdf(lsp), 'r', **kwds[1])", "metadata": "root.StatTestMC.plot_hist", "header": "['class', 'StatTestMC', '(', 'object', ')', ':', '___EOS___']", "index": 296 } ]
[ { "span": "bins=", "start_line": 187, "start_column": 16, "end_line": 187, "end_column": 20 }, { "span": "mcres ", "start_line": 235, "start_column": 16, "end_line": 235, "end_column": 21 }, { "span": "mcres ", "start_line": 239, "start_column": 12, "end_line": 239, "end_column": 17 }, { "span": "fig ", "start_line": 338, "start_column": 8, "end_line": 338, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Stat", "Test", "MC", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "histogram_", "(_", "self_", ",_", "idx_", "=_", "None_", ",_", "crit", "val_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "calcul", "ate", " ", "histo", "gram", " ", "values", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "doe", "s", " ", "not", " ", "do", " ", "any", " ", "plott", "ing", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "I", " ", "don", "'", "t", " ", "remember", " ", "what", " ", "I", " ", "want", "ed", " ", "here", ",", " ", "look", "s", " ", "similar", " ", "to", " ", "the", " ", "new", " ", "cdf", "\\", "10", ";", " ", " ", " ", " ", "method", ",", " ", "but", " ", "this", " ", "als", "o", " ", "doe", "s", " ", "a", " ", "binned", " ", "pdf", " ", "(", "self", ".", "histo", ")", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "mc", "res_", "._", "ndim_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "idx_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mc", "res_", "=_", "self_", "._", "mc", "res_", "[_", ":_", ",_", "idx_", "]_", "\\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_", "(_", "'", "currentl", "y", " ", "only", " ", "1", " ", "statistic", " ", "at", " ", "a", " ", "time", "'_", ")_", "\\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 ", " _", "mc", "res_", "=_", "self_", "._", "mc", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "crit", "val_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "histo", "_", "=_", "np_", "._", "histogram_", "(_", "mc", "res_", ",_", "bins_", "=_", "10_", ")_", "\\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_", "crit", "val_", "[_", "0_", "]_", "==_", "-_", "np_", "._", "inf_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bins_", "=_", "np_", "._", "r\\u_", "[_", "-_", "np_", "._", "inf_", ",_", "crit", "val_", ",_", "np_", "._", "inf_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "crit", "val_", "[_", "0_", "]_", "==_", "-_", "np_", "._", "inf_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bins_", "=_", "np_", "._", "r\\u_", "[_", "bins_", ",_", "np_", "._", "inf_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "histo", "_", "=_", "np_", "._", "histogram_", "(_", "mc", "res_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bins_", "=_", "np_", "._", "r\\u_", "[_", "-_", "np_", "._", "inf_", ",_", "crit", "val_", ",_", "np_", "._", "inf_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "histo", "_", "=_", "histo", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cum", "histo", "_", "=_", "np_", "._", "cumsum_", "(_", "histo", "_", "[_", "0_", "]_", ")_", "*_", "1._", "/_", "self_", "._", "nre", "pl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cum", "histo", "reversed_", "=_", "np_", "._", "cumsum_", "(_", "histo", "_", "[_", "0_", "]_", "[_", ":_", ":_", "-_", "1_", "]_", ")_", "[_", ":_", ":_", "-_", "1_", "]_", "*_", "1._", "/_", "self_", "._", "nre", "pl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "histo", "_", ",_", "self_", "._", "cum", "histo", "_", ",_", "self_", "._", "cum", "histo", "reversed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stat", "Test", "MC", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "quantiles", "_", "(_", "self_", ",_", "idx_", "=_", "None_", ",_", "frac_", "=_", "[_", "0.01_", ",_", "0.025", "_", ",_", "0.05_", ",_", "0.1_", ",_", "0.97", "5_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "calcul", "ate", " ", "quantiles", " ", "of", " ", "Monte", " ", "Carlo", " ", "results", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "similar", " ", "to", " ", "pp", "f", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "idx", " ", ":", " ", "Non", "e", " ", "or", " ", "list", " ", "of", " ", "integ", "ers", "\\", "10", ";", " ", " ", " ", " ", "List", " ", "of", " ", "indice", "s", " ", "int", "o", " ", "the", " ", "Monte", " ", "Carlo", " ", "results", " ", "(", "column", "s", ")", " ", "tha", "t", " ", "shou", "ld", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "used", " ", "in", " ", "the", " ", "calculati", "on", "\\", "10", ";", " ", " ", " ", " ", "frac", " ", ":", " ", "array", "\\u", "like", ",", " ", "float", "\\", "10", ";", " ", " ", " ", " ", "Define", "s", " ", "whi", "ch", " ", "quantiles", " ", "shou", "ld", " ", "be", " ", "calculated", ".", " ", "For", " ", "example", " ", "a", " ", "frac", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "0.", "1", " ", "find", "s", " ", "the", " ", "10", "%", " ", "quantile", ",", " ", "x", " ", "suc", "h", " ", "tha", "t", " ", "cdf", "(", "x", ")=", "0.", "1", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "frac", " ", ":", " ", "ndar", "ray", "\\", "10", ";", " ", " ", " ", " ", "same", " ", "values", " ", "as", " ", "input", ",", " ", "TOD", "O", ":", " ", "I", " ", "shou", "ld", " ", "drop", " ", "this", " ", "again", " ", "?", "\\", "10", ";", " ", " ", " ", " ", "quantiles", " ", ":", " ", "ndar", "ray", ",", " ", "(", "len", "(", "frac", "),", " ", "len", "(", "idx", "))\\", "10", ";", " ", " ", " ", " ", "the", " ", "quantiles", " ", "with", " ", "frac", " ", "in", " ", "rows", " ", "and", " ", "idx", " ", "variab", "les", " ", "in", " ", "column", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "es", "\\", "10", ";", " ", " ", " ", " ", "-----", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "rename", " ", "to", " ", "pp", "f", " ", "?", " ", "make", " ", "frac", " ", "require", "d", "\\", "10", ";", " ", " ", " ", " ", "change", " ", "sequence", " ", "idx", ",", " ", "frac", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "mc", "res_", "._", "ndim_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "idx_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mc", "res_", "=_", "self_", "._", "mc", "res_", "[_", ":_", ",_", "idx_", "]_", "\\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_", "(_", "'", "currentl", "y", " ", "only", " ", "1", " ", "statistic", " ", "at", " ", "a", " ", "time", "'_", ")_", "\\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 ", " _", "mc", "res_", "=_", "self_", "._", "mc", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "frac_", "=_", "frac_", "=_", "np_", "._", "asarray_", "(_", "frac_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mc", "\\u", "sorted_", "=_", "self_", "._", "get", "\\u", "mc", "\\u", "sorted_", "(_", ")_", "[_", ":_", ",_", "idx_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "frac_", ",_", "mc", "\\u", "sorted_", "[_", "(_", "self_", "._", "nre", "pl_", "*_", "frac_", ")_", "._", "astype_", "(_", "int_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stat", "Test", "MC", "_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "plot", "\\u", "hist_", "(_", "self_", ",_", "idx_", ",_", "dist", "pdf_", "=_", "None_", ",_", "bins_", "=_", "50_", ",_", "ax_", "=_", "None_", ",_", "kwds_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "plot", " ", "the", " ", "histo", "gram", " ", "against", " ", "a", " ", "reference", " ", "distribu", "tion", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", "\\", "10", ";", " ", " ", " ", " ", "----------", "\\", "10", ";", " ", " ", " ", " ", "idx", " ", ":", " ", "Non", "e", " ", "or", " ", "list", " ", "of", " ", "integ", "ers", "\\", "10", ";", " ", " ", " ", " ", "List", " ", "of", " ", "indice", "s", " ", "int", "o", " ", "the", " ", "Monte", " ", "Carlo", " ", "results", " ", "(", "column", "s", ")", " ", "tha", "t", " ", "shou", "ld", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "used", " ", "in", " ", "the", " ", "calculati", "on", "\\", "10", ";", " ", " ", " ", " ", "dist", "pdf", " ", ":", " ", "calla", "ble", "\\", "10", ";", " ", " ", " ", " ", "probabilit", "y", " ", "densit", "y", " ", "function", " ", "of", " ", "reference", " ", "distribu", "tion", "\\", "10", ";", " ", " ", " ", " ", "bins", " ", ":", " ", "integ", "er", " ", "or", " ", "array", "\\u", "like", "\\", "10", ";", " ", " ", " ", " ", "used", " ", "unchanged", " ", "for", " ", "mat", "plotlib", "s", " ", "hist", " ", "call", "\\", "10", ";", " ", " ", " ", " ", "ax", " ", ":", " ", "TOD", "O", ":", " ", "not", " ", "implemented", " ", "ye", "t", "\\", "10", ";", " ", " ", " ", " ", "kwd", "s", " ", ":", " ", "Non", "e", " ", "or", " ", "tuple", " ", "of", " ", "dict", "s", "\\", "10", ";", " ", " ", " ", " ", "extra", " ", "keyw", "ord", " ", "options", " ", "to", " ", "the", " ", "calls", " ", "to", " ", "the", " ", "mat", "plotlib", " ", "function", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "first", " ", "dictionar", "y", " ", "is", " ", "for", " ", "his", ",", " ", "second", " ", "dictionar", "y", " ", "for", " ", "plot", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "reference", " ", "distribu", "tion", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", "\\", "10", ";", " ", " ", " ", " ", "-------", "\\", "10", ";", " ", " ", " ", " ", "Non", "e", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "kwds_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwds_", "=_", "(_", "{_", "}_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "mc", "res_", "._", "ndim_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "idx_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mc", "res_", "=_", "self_", "._", "mc", "res_", "[_", ":_", ",_", "idx_", "]_", "\\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_", "(_", "'", "currentl", "y", " ", "only", " ", "1", " ", "statistic", " ", "at", " ", "a", " ", "time", "'_", ")_", "\\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 ", " _", "mc", "res_", "=_", "self_", "._", "mc", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lsp", "_", "=_", "np_", "._", "linspace_", "(_", "mc", "res_", "._", "min_", "(_", ")_", ",_", "mc", "res_", "._", "max_", "(_", ")_", ",_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "I", " ", "don", "'", "t", " ", "want", " ", "to", " ", "figure", " ", "this", " ", "out", " ", "now_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "ax", "=", "Non", "e", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "fig", " ", "=", " ", "plt", ".", "figure", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "ax", " ", "=", " ", "fig", ".", "add", "axis", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "fig_", "=_", "plt_", "._", "figure_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "hist_", "(_", "mc", "res_", ",_", "bins_", "=_", "bins_", ",_", "normed_", "=_", "True_", ",_", "**_", "kwds_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "plot_", "(_", "lsp", "_", ",_", "dist", "pdf_", "(_", "lsp", "_", ")_", ",_", "'", "r", "'_", ",_", "**_", "kwds_", "[_", "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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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 ]
Unused import
gkno/gkno_launcher/src/gkno/pipelineConfigurationErrors.py
[ { "content": "#!/usr/bin/python\n\nfrom __future__ import print_function\n\nimport inspect\nfrom inspect import currentframe, getframeinfo\n\nimport errors\nfrom errors import *\n\nimport os\nimport sys\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class pipelineErrors:\n\n # Initialise.\n\n ##################################\n ## Errors with top level fields ##\n ##################################\n\n # If the configuration file type (tool or pipeline) has not been defined.\n\n # If the configuration file type is not set to pipeline.\n\n ###################################\n ## Errors with the tasks section ##\n ###################################\n\n # Invalid tool.\n\n # If two tasks have been given the same name.\n\n # If a configuration file contains has repeated definitions of the same long form argument.\n\n # If a configuration file contains has repeated definitions of the same short form argument.\n\n # If a long form argument is defined with no short form.\n\n # If a short form argument is defined with no long form.\n\n # A pipeline long form argument conflicts with a gkno argument.\n\n # A node ID is also the name of a task.\n\n # If a task argument is listed as greedy, but the argument is not a valid argument for the tool that the task uses.\n\n # If a task argument is listed as greedy, but the argument is not identified as accepting multiple values.\n\n # If a task is marked as being terminated if there are no files to consolidate, but the task is not marked as a consolidating task.\n\n # If an invalid set of streaming instructions is requested.\n\n #############################################\n ## Errors in the terminate pipeline section #\n #############################################\n\n # If a node in the 'replace nodes' section is invalid.\n\n #####################################\n ## Errors in the arguments section ##\n #####################################\n\n # A node id supplied with a pipeline argument is not valid.\n\n # A long form argument is defined multiple times.\n\n # A short form argument is defined multiple times.\n\n # If an argument shares a name with a pipeline task.\n\n ##########################################\n ## Errors in the unique or shared nodes ##\n ##########################################\n\n # A configuraiton node supplies an argument to a task which is running a pipeline and the node within the pipeline is not specified.\n\n # An external node id is invalid.\n\n # An external node id is provided for a task that runs a tool.\n\n # A supplied task is not valid.\n\n # A configuration file node contains a tool argument that is not valid.\n\n # If a node has a non-unique id.\n\n # If a node has the same id as a task.\n\n ##################################\n ## Errors with connecting nodes ##\n ##################################\n\n # A node connection references a non-existent node.\n\n ##################################################\n ## Errors generated while dealing with streams. ##\n ##################################################\n\n # If a task is marked as outputting to a stream, but has no argument marked as\n # being able to output to a stream.\n\n # If a tool is marked as outputting to a stream, but no task in the pipeline is \n # marked as accepting a stream.\n\n # If a tool is marked as outputting to a stream, but no task in the pipeline is \n # marked as accepting a stream.", "metadata": "root.pipelineErrors", "header": "['module', '___EOS___']", "index": 13 }, { "content": " def __init__(self):\n\n # Get general error writing and termination methods.\n self.errors = errors()\n\n # The error messages are stored in the following list.\n self.text = []\n\n # For a list of all error code values, see adminErrors.py.\n self.errorCode = '7'", "metadata": "root.pipelineErrors.__init__", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 16 }, { "content": " def noConfigurationType(self, name):\n self.text.append('Error processing pipeline configuration file: ' + name + '.json.')\n self.text.append('All gkno configuration files are required to contain the \\'configuration type\\' field. This can take the value \\'tool\\' ' + \\\n 'or \\'pipeline\\' and is used to ensure that it is possible to distinguish between tool and pipeline configuration files.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.noConfigurationType", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 32 }, { "content": " def invalidConfigurationType(self, name, configurationType):\n self.text.append('Error processing configuration file: ' + name + '.json.')\n self.text.append('All gkno configuration files are required to contain the \\'configuration type\\' field. The configuration file \\'' + name + \\\n '.json\\' is being processed as a pipeline, however, the type is listed as \\'' + configurationType + '\\'. Please ensure that \\'' + name + \\\n '\\' is a pipeline and not a tool, and that the configuration file type is correctly defined within the configuration file (i.e. the ' + \\\n 'configuration type is set to \\'pipeline\\').')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.invalidConfigurationType", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 40 }, { "content": " def invalidTool(self, tool):\n self.text.append('Invalid tool in pipeline tasks.')\n self.text.append('The pipeline tasks section of the pipeline configuration file contains a user defined task name and the tool or ' + \\\n 'pipeline with which it is associated. In this section, the tool \\'' + tool + '\\' is defined, but this is not a tool within gkno. ' + \\\n 'Please check the pipeline configuration file and ensure that all defined tasks point to valid tools or pipelines.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.invalidTool", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 54 }, { "content": " def repeatedTaskName(self, pipeline, task):\n self.text.append('Repeated task name in pipeline: ' + pipeline + '.')\n self.text.append('Each task in the pipeline is defined in the \\'pipeline tasks\\' section of the pipeline configuration file. Each task name must be ' + \\\n 'unique so that there is no ambiguity about how to construct the pipeline graph, however, multiple tasks in this section have been given the name \\'' + \\\n task + '\\'. Please ensure that all task names in the pipeline configuration file are unique.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.repeatedTaskName", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 63 }, { "content": " def repeatedLongFormArgument(self, nodeId, longFormArgument):\n self.text.append('Repeated argument in the pipeline configuration file.')\n self.text.append('The pipeline configuration file contains a definition for a graph node with ID \\'' + nodeId + '\\' which defines the ' + \\\n 'long form argument \\'' + longFormArgument + '\\'. This argument has already been defined in the configuration file. Please ensure that all ' + \\\n 'arguments are unique.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.repeatedLongFormArgument", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 72 }, { "content": " def repeatedShortFormArgument(self, nodeId, longFormArgument, shortFormArgument):\n self.text.append('Repeated argument in the pipeline configuration file.')\n self.text.append('The pipeline configuration file contains a definition for a graph node with ID \\'' + nodeId + '\\' which defines the ' + \\\n 'short form argument \\'' + shortFormArgument + '\\' associated with the long form argument \\'' + longFormArgument + '\\'. This argument has ' + \\\n 'already been defined in the configuration file. Please ensure that all arguments are unique.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.repeatedShortFormArgument", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 81 }, { "content": " def noShortFormArgument(self, nodeId, longFormArgument):\n self.text.append('No defined short form argument in the pipeline configuration file.')\n self.text.append('The pipeline configuration file contains a definition for a graph node with ID \\'' + nodeId + '\\' which defines the ' + \\\n 'long form argument \\'' + longFormArgument + '\\'. There is no short form argument associated with this, however. Please ensure that all ' + \\\n 'nodes in the configuration file defining arguments contain both a short and long form version of the argument.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.noShortFormArgument", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 90 }, { "content": " def noLongFormArgument(self, nodeId, shortFormArgument):\n self.text.append('No defined long form argument in the pipeline configuration file.')\n self.text.append('The pipeline configuration file contains a definition for a graph node with ID \\'' + nodeId + '\\' which defines the ' + \\\n 'short form argument \\'' + shortFormArgument + '\\'. There is no long form argument associated with this, however. Please ensure that all ' + \\\n 'nodes in the configuration file defining arguments contain both a short and long form version of the argument.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.noLongFormArgument", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 99 }, { "content": " def conflictWithGknoArguments(self, longFormArgument, shortFormArgument, isLongForm):\n self.text.append('Pipeline argument conflicts with a gkno argument.')\n\n # If a long form argument conflicts.\n if isLongForm:\n self.text.append('The pipeline argument \\'' + longFormArgument + '\\' is also a gkno argument. Please modify the pipeline configuration ' + \\\n 'file such that all arguments are unique.')\n\n # If a short form argument conflicts.\n else:\n self.text.append('The pipeline argument \\'' + longFormArgument + '\\' has the short form \\'' + shortFormArgument + '\\'. This short form is ' + \\\n 'shared with the short form version of a gkno argument. Please modify the pipeline configuration file such that all arguments (both the ' + \\\n 'long and short forms are unique.')\n\n # Write out the error and terminate.\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.conflictWithGknoArguments", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 108 }, { "content": " def nodeIdIsTaskID(self, name, node, id):\n self.text.append('Node ID conflicts with a task ID.')\n self.text.append('The configuration file for the \\'' + name + '\\' pipeline contains a node in the \\'' + node + '\\' section with the ' + \\\n 'id \\'' + id + '\\'. This is also the name of a task in the pipeline. All the task names and node ids within a single configuration ' + \\\n 'file must be unique. Please amend the configuration file to make sure that all of the ids are unique.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.nodeIdIsTaskID", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 127 }, { "content": " def invalidGreedyArgument(self, name, task, tool, argument):\n self.text.append('Invalid greedy argument.')\n self.text.append('The configuration file for the \\'' + name + '\\' pipeline contains information for the task \\'' + task + '\\', which ' + \\\n 'uses the tool \\'' + tool + '\\'. The configuration file identifies the argument \\'' + argument + '\\' as being greedy, but this argument ' + \\\n 'is not a valid argument for the tool. Please ensure that the correct argument has been supplied as a greedy argument.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.invalidGreedyArgument", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 136 }, { "content": " def greedySingleValueArgument(self, name, task, tool, argument):\n self.text.append('Invalid greedy argument.')\n self.text.append('The configuration file for the \\'' + name + '\\' pipeline contains information for the task \\'' + task + '\\', which ' + \\\n 'uses the tool \\'' + tool + '\\'. The configuration file identifies the argument \\'' + argument + '\\' as being greedy, but this argument ' + \\\n 'is not listed as accepting multiple values in the tool configuration file. Please ensure that the correct argument has been supplied as ' + \\\n 'a greedy argument.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.greedySingleValueArgument", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 145 }, { "content": " def terminateConsolidateError(self, name, task):\n self.text.append('Invalid termination instructions.')\n self.text.append('The configuration file for the \\'' + name + '\\' pipeline contains information for the task \\'' + task + '\\'. This task has ' + \\\n 'the attribute \\'terminate if no consolidation\\' set, but this attribute is only valid for tasks that also have \\'consolidate divisions\\' set ' + \\\n 'to true, which this task does not. Please correct the errors in the pipeline configuration file.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.terminateConsolidateError", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 155 }, { "content": " def invalidStreamSet(self, pipeline, task, name, validSets, isInput):\n text = 'input' if isInput else 'output'\n self.text.append('Invalid ' + text + ' streaming instruction set.')\n self.text.append('The configuration file for the \\'' + pipeline + '\\' pipeline contains information for the task \\'' + task + '\\'. This task ' + \\\n 'deals with streaming files and, in particular, the ' + text + ' stream has the instruction set \\'' + name + '\\' specified. This is an invalid ' + \\\n 'set of instructions; the valid values are:')\n self.text.append('\\t')\n for setName in validSets: self.text.append('\\t' + setName)\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.invalidStreamSet", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 164 }, { "content": " def invalidNodeInTermination(self, name, nodeId, text):\n self.text.append('Invalid node Id in the \\'terminate pipeline\\' section.')\n self.text.append('The configuration file for the \\'' + name + '\\' pipeline contains information in the \\'terminate pipeline\\' section ' + \\\n 'that describes conditions and instructions for creating a pipeline that doesn\\'t use all of the defined tasks. In the \\'replace nodes\\' ' + \\\n 'section, one of the \\'' + text + '\\' nodes (' + nodeId + ') is invalid for the pipeline.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.invalidNodeInTermination", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 180 }, { "content": " def invalidNodeInArgument(self, pipeline, argument, address, category):\n self.text.append('Invalid node address supplied with argument.')\n self.text.append('The configuration file for the \\'' + pipeline + '\\' pipeline contains information in the \\'' + category + '\\' section ' + \\\n 'of \\'arguments\\' for the argument \\'' + argument + '\\'. This argument is defined as pointing to the node with address \\'' + \\\n address + '\\', but this address does not point to a valid node in the configuration file. Please ensure that the node address provided ' + \\\n 'with the argument is the ID of one of the nodes in the unique or shared nodes of the configuration file. Note that if the pipeline contains ' + \\\n 'tasks that are themselves pipelines, this address could be pointing to a node in one of the nested configuration files.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.invalidNodeInArgument", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 193 }, { "content": " def repeatedLongFormArgument(self, helpInfo):\n self.text.append('Repeated long form argument in pipeline configuration file.')\n self.text.append('The configuration file for pipeline \\'' + helpInfo[0] + '\\' contains information for a number of pipeline arguments. The \\'' + \\\n helpInfo[1] + '\\' section contains information for the argument \\'' + helpInfo[2] + '\\' but this long form argument has already been defined ' + \\\n 'in the configuration file. Please ensure that all arguments in the configuration file are unique.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.repeatedLongFormArgument", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 204 }, { "content": " def repeatedShortFormArgument(self, helpInfo):\n self.text.append('Repeated short form argument in pipeline configuration file.')\n self.text.append('The configuration file for pipeline \\'' + helpInfo[0] + '\\' contains information for a number of pipeline arguments. The \\'' + \\\n helpInfo[1] + '\\' section contains information for the argument \\'' + helpInfo[2] + '\\' but this short form argument has already been defined ' + \\\n 'in the configuration file. Please ensure that all arguments in the configuration file are unique.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.repeatedShortFormArgument", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 213 }, { "content": " def argumentIsTask(self, longFormArgument, shortFormArgument, isLongForm):\n text = 'long' if isLongForm else 'short'\n self.text.append('A pipeline argument shares a name with a pipeline task.')\n self.text.append('The user is permitted to define the name of a pipeline task on the command line in order to set parameters for that task ' + \\\n 'that have not been given specific pipeline arguments. In order for this to work, no arguments for the pipeline may share a name with a ' + \\\n 'pipeline task. There is a defined pipeline argument \\'' + longFormArgument + ' (' + shortFormArgument + ')\\', where the ' + text + ' ' + \\\n 'form of the argument is the name of a pipeline task. Please change the name of the pipeline task or the argument to remove this conflict')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.argumentIsTask", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 222 }, { "content": " def missingNodeIdForPipelineTask(self, pipeline, nodeType, nodeId, task):\n self.text.append('Invalid information in configuration file node.')\n self.text.append('The configuration file for the \\'' + pipeline + '\\' pipeline contains a node with id \\'' + nodeId + '\\' in the \\'' + \\\n nodeType + ' graph nodes\\' section. This node connects with the task \\'' + task + '\\', which is a task that itself runs a pipeline. ' + \\\n 'In this case, the node id of the node in the associated pipeline needs to supplied (and not task argument information). The node id ' + \\\n 'has not been supplied in this case. Please check the configuration file and ensure that the correct information is provided.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.missingNodeIdForPipelineTask", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 237 }, { "content": " def invalidNodeForExternalPipeline(self, pipeline, nodeType, nodeId, task, externalPipeline, externalNodeId):\n if not externalPipeline: externalPipeline = 'bob'\n self.text.append('Invalid external node id in configuration file node.')\n self.text.append('The configuration file for the \\'' + pipeline + '\\' pipeline contains a node with id \\'' + nodeId + '\\' in the \\'' + \\\n nodeType + ' graph nodes\\' section. This node connects with the task \\'' + task + '\\', which is a task that itself runs the pipeline ' + \\\n '\\'' + externalPipeline + '\\'. The node id \\'' + externalNodeId + '\\' is supplied as the node within the external pipeline with which ' + \\\n 'to connect, but this is not a valid node for the pipeline. Please check that all information in the configuration file is correct.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.invalidNodeForExternalPipeline", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 247 }, { "content": " def externalNodeForTask(self, pipeline, nodeType, nodeId, task, externalNodeId):\n self.text.append('Invalid external node id in configuration file node.')\n self.text.append('The configuration file for the \\'' + pipeline + '\\' pipeline contains a node with id \\'' + nodeId + '\\' in the \\'' + \\\n nodeType + ' graph nodes\\' section. This node connects with the task \\'' + task + '\\', which is a task that runs a tool. When this ' + \\\n 'is the case, the \\'task argument\\' field must also be present to define which of the tools arguments this node connects with. Instead, ' + \\\n 'the \\'node id\\' field has been provided. This is only valid for tasks that themselves run pipelines.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.externalNodeForTask", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 258 }, { "content": " def invalidTaskInNode(self, pipeline, nodeType, nodeId, task):\n self.text.append('Invalid task in configuration file node.')\n self.text.append('The configuration file for the \\'' + pipeline + '\\' pipeline contains a node with id \\'' + nodeId + '\\' in the \\'' + \\\n nodeType + ' graph nodes\\' section. Within this node, the task \\'' + task + '\\' is used, but this task has not been defined in the ' + \\\n '\\'pipeline tasks\\' section of the configuration file and consequently is not valid. Please check that all tasks in the configuration ' + \\\n 'file are valid for the pipeline.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.invalidTaskInNode", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 268 }, { "content": " def invalidToolArgument(self, pipeline, nodeType, nodeId, task, tool, argument):\n self.text.append('Invalid tool argument.')\n self.text.append('The configuration file for the \\'' + pipeline + '\\' pipeline contains a node with id \\'' + nodeId + '\\' in the \\'' + \\\n nodeType + ' graph nodes\\' section. Within this node, the task \\'' + task + '\\' which uses the tool \\'' + tool + '\\' is associated ' + \\\n 'with the argument \\'' + argument + '\\', but this argument is not valid for the tool. Please check that all of the tool arguments ' + \\\n 'in the pipeline configuration file are valid for the tools they are linked to.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.invalidToolArgument", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 278 }, { "content": " def repeatedNodeId(self, helpInfo):\n self.text.append('Repeated pipeline node id.')\n self.text.append('The configuration file for the pipeline \\'' + helpInfo[0] + '\\' contains a node in the \\'' + helpInfo[1] + '\\' section ' + \\\n 'with the same id (' + helpInfo[2] + ') as another node in the pipeline. All nodes must have unique ids in order to construct the ' + \\\n 'pipeline graph. Please ensure that all nodes defined in the configuration file are unique.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.repeatedNodeId", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 288 }, { "content": " def nodeIdIsTaskId(self, nodeType, helpInfo):\n self.text.append('Configuration file node has the same id as a task.')\n self.text.append('A node in the \\'' + helpInfo[1] + '\\' section of the pipeline configuration file for pipeline \\'' + helpInfo[0] + \\\n '\\' has the id \\'' + helpInfo[2] + '\\'. This is the same id as a task defined in the \\'pipeline tasks\\' section. All the node ids ' + \\\n 'in the configuration file (across all task, unique nodes and shared nodes) must be unique. Please update the ids to ensure that they ' + \\\n 'are all unique.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.nodeIdIsTaskId", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 297 }, { "content": " def invalidNodeConnection(self, source, target, text):\n self.text.append('Error with node connections.')\n self.text.append('In the \\'connect nodes\\' section of the pipeline configuration file, a connection is defined between the nodes \\'' + \\\n source + '\\' and \\'' + target + '\\'. The ' + text + ' node is not a valid node in the graph. Please ensure that all of the connections ' + \\\n 'are defined between a valid pair of graph nodes.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.invalidNodeConnection", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 311 }, { "content": " def noOutputStreamArgument(self, task, tool):\n self.text.append('Error with output stream.')\n self.text.append('The task \\'' + task + '\\', using the tool \\'' + tool + '\\' is marked as outputting to a stream in the \\'pipeline ' + \\\n 'tasks\\' section of the configuration file, but no output arguments are identified with streaming outputs. Please check that this task is ' + \\\n 'supposed to be outputting to a stream and if so, ensure that one of the output arguments in the tool configuration file has instructions ' + \\\n 'on how to be handled if the output is a stream.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.noOutputStreamArgument", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 325 }, { "content": " def noStreamInstructions(self, task, tool, inputTask, inputTool):\n self.text.append('Error with streaming files.')\n self.text.append('The task \\'' + task + '\\', using the tool \\'' + tool + '\\' is marked as outputting to a stream in the \\'pipeline ' + \\\n 'tasks\\' section of the configuration file and the task \\'' + inputTask + '\\', using the tool \\'' + inputTool + '\\' accepts the stream as ' + \\\n 'input. There are no input arguments for the \\'' + inputTask + '\\' task that have instructions on how to use a stream as input. Please check ' + \\\n 'that the correct task is marked as accepting a stream, and ensure that an input argument in it\\'s tool configuration file has instructions ' + \\\n 'on how to modify the argument to handle a streaming input.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.noStreamInstructions", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 336 }, { "content": " def noNodeAcceptingStream(self, task, tool):\n self.text.append('Error with streaming files.')\n self.text.append('The task \\'' + task + '\\', using the tool \\'' + tool + '\\' is marked as outputting to a stream in the \\'pipeline ' + \\\n 'tasks\\' section of the configuration file, but no tasks are marked as accepting a stream. Since a task is outputting to a stream, ' + \\\n 'another task (by convention, the next task in the list) must be able to accept the stream as input. This is achieved by including the ' + \\\n '\\'\"input is stream\" : true\\' field in the \\'pipeline tasks\\' section for the task that will accept a streaming input. Please ensure that ' + \\\n 'this is the case.')\n self.errors.writeFormattedText(self.text, errorType = 'error')\n self.errors.terminate(self.errorCode)", "metadata": "root.pipelineErrors.noNodeAcceptingStream", "header": "['class', 'pipelineErrors', ':', '___NEWLINE___', '___NL___', '# Initialise.', '___NL___', '___EOS___']", "index": 348 } ]
[ { "span": "import inspect", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 14 }, { "span": "from inspect import currentframe, getframeinfo", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 46 }, { "span": "import os", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 9 }, { "span": "import sys", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 10 } ]
[]
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_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "inspect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "inspect_", "import_", "currentframe_", ",_", "getf", "rame", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "errors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "errors_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\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_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Error", "s", " ", "with", " ", "top", " ", "level", " ", "fields", " ", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "configura", "tion", " ", "file", " ", "type", " ", "(", "tool", " ", "or", " ", "pipeline", ")", " ", "has", " ", "not", " ", "bee", "n", " ", "defin", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "configura", "tion", " ", "file", " ", "type", " ", "is", " ", "not", " ", "set", " ", "to", " ", "pipeline", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Error", "s", " ", "with", " ", "the", " ", "task", "s", " ", "section", " ", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Inva", "lid", " ", "tool", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "two", " ", "task", "s", " ", "have", " ", "bee", "n", " ", "give", "n", " ", "the", " ", "same", " ", "name", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "configura", "tion", " ", "file", " ", "contain", "s", " ", "has", " ", "repeated", " ", "definit", "ion", "s", " ", "of", " ", "the", " ", "same", " ", "long", " ", "form", " ", "argu", "ment", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "configura", "tion", " ", "file", " ", "contain", "s", " ", "has", " ", "repeated", " ", "definit", "ion", "s", " ", "of", " ", "the", " ", "same", " ", "short", " ", "form", " ", "argu", "ment", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "long", " ", "form", " ", "argu", "ment", " ", "is", " ", "defin", "ed", " ", "with", " ", "no", " ", "short", " ", "form", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "short", " ", "form", " ", "argu", "ment", " ", "is", " ", "defin", "ed", " ", "with", " ", "no", " ", "long", " ", "form", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "pipeline", " ", "long", " ", "form", " ", "argu", "ment", " ", "confl", "icts", " ", "with", " ", "a", " ", "gk", "no", " ", "argu", "ment", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "node", " ", "ID", " ", "is", " ", "als", "o", " ", "the", " ", "name", " ", "of", " ", "a", " ", "task", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "task", " ", "argu", "ment", " ", "is", " ", "liste", "d", " ", "as", " ", "greedy", ",", " ", "but", " ", "the", " ", "argu", "ment", " ", "is", " ", "not", " ", "a", " ", "valid", " ", "argu", "ment", " ", "for", " ", "the", " ", "tool", " ", "tha", "t", " ", "the", " ", "task", " ", "use", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "task", " ", "argu", "ment", " ", "is", " ", "liste", "d", " ", "as", " ", "greedy", ",", " ", "but", " ", "the", " ", "argu", "ment", " ", "is", " ", "not", " ", "identifi", "ed", " ", "as", " ", "accept", "ing", " ", "multiple", " ", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "task", " ", "is", " ", "marked", " ", "as", " ", "bei", "ng", " ", "terminate", "d", " ", "if", " ", "there", " ", "are", " ", "no", " ", "files", " ", "to", " ", "consolidat", "e", ",", " ", "but", " ", "the", " ", "task", " ", "is", " ", "not", " ", "marked", " ", "as", " ", "a", " ", "consolidat", "ing", " ", "task", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "an", " ", "invalid", " ", "set", " ", "of", " ", "stream", "ing", " ", "instruct", "ion", "s", " ", "is", " ", "request", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Error", "s", " ", "in", " ", "the", " ", "terminate", " ", "pipeline", " ", "section", " ", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "node", " ", "in", " ", "the", " ", "'", "replace", " ", "nodes", "'", " ", "section", " ", "is", " ", "invalid", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Error", "s", " ", "in", " ", "the", " ", "argu", "ment", "s", " ", "section", " ", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "node", " ", "id", " ", "supplie", "d", " ", "with", " ", "a", " ", "pipeline", " ", "argu", "ment", " ", "is", " ", "not", " ", "valid", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "long", " ", "form", " ", "argu", "ment", " ", "is", " ", "defin", "ed", " ", "multiple", " ", "times", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "short", " ", "form", " ", "argu", "ment", " ", "is", " ", "defin", "ed", " ", "multiple", " ", "times", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "an", " ", "argu", "ment", " ", "share", "s", " ", "a", " ", "name", " ", "with", " ", "a", " ", "pipeline", " ", "task", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Error", "s", " ", "in", " ", "the", " ", "unique", " ", "or", " ", "shared", " ", "nodes", " ", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "#########", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "configura", "ito", "n", " ", "node", " ", "supplie", "s", " ", "an", " ", "argu", "ment", " ", "to", " ", "a", " ", "task", " ", "whi", "ch", " ", "is", " ", "runn", "ing", " ", "a", " ", "pipeline", " ", "and", " ", "the", " ", "node", " ", "within", " ", "the", " ", "pipeline", " ", "is", " ", "not", " ", "specified", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "An", " ", "external", " ", "node", " ", "id", " ", "is", " ", "invalid", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "An", " ", "external", " ", "node", " ", "id", " ", "is", " ", "provided", " ", "for", " ", "a", " ", "task", " ", "tha", "t", " ", "runs", " ", "a", " ", "tool", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "supplie", "d", " ", "task", " ", "is", " ", "not", " ", "valid", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "configura", "tion", " ", "file", " ", "node", " ", "contain", "s", " ", "a", " ", "tool", " ", "argu", "ment", " ", "tha", "t", " ", "is", " ", "not", " ", "valid", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "node", " ", "has", " ", "a", " ", "non", "-", "unique", " ", "id", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "node", " ", "has", " ", "the", " ", "same", " ", "id", " ", "as", " ", "a", " ", "task", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Error", "s", " ", "with", " ", "connecti", "ng", " ", "nodes", " ", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "node", " ", "connecti", "on", " ", "reference", "s", " ", "a", " ", "non", "-", "existen", "t", " ", "node", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Error", "s", " ", "generat", "ed", " ", "whi", "le", " ", "deal", "ing", " ", "with", " ", "stream", "s", ".", " ", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "######", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "task", " ", "is", " ", "marked", " ", "as", " ", "output", "ting", " ", "to", " ", "a", " ", "stream", ",", " ", "but", " ", "has", " ", "no", " ", "argu", "ment", " ", "marked", " ", "as_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bei", "ng", " ", "able", " ", "to", " ", "output", " ", "to", " ", "a", " ", "stream", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "tool", " ", "is", " ", "marked", " ", "as", " ", "output", "ting", " ", "to", " ", "a", " ", "stream", ",", " ", "but", " ", "no", " ", "task", " ", "in", " ", "the", " ", "pipeline", " ", "is", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "marked", " ", "as", " ", "accept", "ing", " ", "a", " ", "stream", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "tool", " ", "is", " ", "marked", " ", "as", " ", "output", "ting", " ", "to", " ", "a", " ", "stream", ",", " ", "but", " ", "no", " ", "task", " ", "in", " ", "the", " ", "pipeline", " ", "is", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "marked", " ", "as", " ", "accept", "ing", " ", "a", " ", "stream", "._", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\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\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "genera", "l", " ", "error", " ", "writ", "ing", " ", "and", " ", "termination", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "errors_", "=_", "errors_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "error", " ", "message", "s", " ", "are", " ", "store", "d", " ", "in", " ", "the", " ", "follow", "ing", " ", "list", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "text_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "a", " ", "list", " ", "of", " ", "all", " ", "error", " ", "code", " ", "values", ",", " ", "see", " ", "admin", "Error", "s", ".", "py", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "error", "Code_", "=_", "'", "7", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "no", "Configura", "tion", "Type_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Error", " ", "process", "ing", " ", "pipeline", " ", "configura", "tion", " ", "file", ":", " ", "'_", "+_", "name_", "+_", "'.", "json", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "All", " ", "gk", "no", " ", "configura", "tion", " ", "files", " ", "are", " ", "require", "d", " ", "to", " ", "contain", " ", "the", " ", "\\\\'", "configura", "tion", " ", "type", "\\\\'", " ", "field", ".", " ", "Thi", "s", " ", "can", " ", "take", " ", "the", " ", "value", " ", "\\\\'", "tool", "\\\\'", " ", "'_", "+_", "'", "or", " ", "\\\\'", "pipeline", "\\\\'", " ", "and", " ", "is", " ", "used", " ", "to", " ", "ensure", " ", "tha", "t", " ", "it", " ", "is", " ", "possib", "le", " ", "to", " ", "distinguish", " ", "bet", "ween", " ", "tool", " ", "and", " ", "pipeline", " ", "configura", "tion", " ", "files", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "invalid", "Configura", "tion", "Type_", "(_", "self_", ",_", "name_", ",_", "configura", "tion", "Type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Error", " ", "process", "ing", " ", "configura", "tion", " ", "file", ":", " ", "'_", "+_", "name_", "+_", "'.", "json", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "All", " ", "gk", "no", " ", "configura", "tion", " ", "files", " ", "are", " ", "require", "d", " ", "to", " ", "contain", " ", "the", " ", "\\\\'", "configura", "tion", " ", "type", "\\\\'", " ", "field", ".", " ", "The", " ", "configura", "tion", " ", "file", " ", "\\\\''_", "+_", "name_", "+_", "'.", "json", "\\\\'", " ", "is", " ", "bei", "ng", " ", "process", "ed", " ", "as", " ", "a", " ", "pipeline", ",", " ", "how", "ever", ",", " ", "the", " ", "type", " ", "is", " ", "liste", "d", " ", "as", " ", "\\\\''_", "+_", "configura", "tion", "Type_", "+_", "'\\\\'", ".", " ", "Ple", "ase", " ", "ensure", " ", "tha", "t", " ", "\\\\''_", "+_", "name_", "+_", "'\\\\'", " ", "is", " ", "a", " ", "pipeline", " ", "and", " ", "not", " ", "a", " ", "tool", ",", " ", "and", " ", "tha", "t", " ", "the", " ", "configura", "tion", " ", "file", " ", "type", " ", "is", " ", "correct", "ly", " ", "defin", "ed", " ", "within", " ", "the", " ", "configura", "tion", " ", "file", " ", "(", "i", ".", "e", ".", " ", "the", " ", "'_", "+_", "'", "configura", "tion", " ", "type", " ", "is", " ", "set", " ", "to", " ", "\\\\'", "pipeline", "\\\\')", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "invalid", "Tool_", "(_", "self_", ",_", "tool_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Inva", "lid", " ", "tool", " ", "in", " ", "pipeline", " ", "task", "s", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "pipeline", " ", "task", "s", " ", "section", " ", "of", " ", "the", " ", "pipeline", " ", "configura", "tion", " ", "file", " ", "contain", "s", " ", "a", " ", "user", " ", "defin", "ed", " ", "task", " ", "name", " ", "and", " ", "the", " ", "tool", " ", "or", " ", "'_", "+_", "'", "pipeline", " ", "with", " ", "whi", "ch", " ", "it", " ", "is", " ", "associate", "d", ".", " ", "In", " ", "this", " ", "section", ",", " ", "the", " ", "tool", " ", "\\\\''_", "+_", "tool_", "+_", "'\\\\'", " ", "is", " ", "defin", "ed", ",", " ", "but", " ", "this", " ", "is", " ", "not", " ", "a", " ", "tool", " ", "within", " ", "gk", "no", ".", " ", "'_", "+_", "'", "Ple", "ase", " ", "check", " ", "the", " ", "pipeline", " ", "configura", "tion", " ", "file", " ", "and", " ", "ensure", " ", "tha", "t", " ", "all", " ", "defin", "ed", " ", "task", "s", " ", "point", " ", "to", " ", "valid", " ", "tool", "s", " ", "or", " ", "pipeline", "s", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "repeated", "Task", "Name_", "(_", "self_", ",_", "pipeline_", ",_", "task_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Repeat", "ed", " ", "task", " ", "name", " ", "in", " ", "pipeline", ":", " ", "'_", "+_", "pipeline_", "+_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "Ea", "ch", " ", "task", " ", "in", " ", "the", " ", "pipeline", " ", "is", " ", "defin", "ed", " ", "in", " ", "the", " ", "\\\\'", "pipeline", " ", "task", "s", "\\\\'", " ", "section", " ", "of", " ", "the", " ", "pipeline", " ", "configura", "tion", " ", "file", ".", " ", "Ea", "ch", " ", "task", " ", "name", " ", "must", " ", "be", " ", "'_", "+_", "'", "unique", " ", "so", " ", "tha", "t", " ", "there", " ", "is", " ", "no", " ", "ambi", "guit", "y", " ", "abo", "ut", " ", "how", " ", "to", " ", "construct", " ", "the", " ", "pipeline", " ", "graph", ",", " ", "how", "ever", ",", " ", "multiple", " ", "task", "s", " ", "in", " ", "this", " ", "section", " ", "have", " ", "bee", "n", " ", "give", "n", " ", "the", " ", "name", " ", "\\\\''_", "+_", "task_", "+_", "'\\\\'", ".", " ", "Ple", "ase", " ", "ensure", " ", "tha", "t", " ", "all", " ", "task", " ", "names", " ", "in", " ", "the", " ", "pipeline", " ", "configura", "tion", " ", "file", " ", "are", " ", "unique", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "repeated", "Long", "Form", "Argument_", "(_", "self_", ",_", "node", "Id_", ",_", "long", "Form", "Argument_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Repeat", "ed", " ", "argu", "ment", " ", "in", " ", "the", " ", "pipeline", " ", "configura", "tion", " ", "file", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "pipeline", " ", "configura", "tion", " ", "file", " ", "contain", "s", " ", "a", " ", "definit", "ion", " ", "for", " ", "a", " ", "graph", " ", "node", " ", "with", " ", "ID", " ", "\\\\''_", "+_", "node", "Id_", "+_", "'\\\\'", " ", "whi", "ch", " ", "defin", "es", " ", "the", " ", "'_", "+_", "'", "long", " ", "form", " ", "argu", "ment", " ", "\\\\''_", "+_", "long", "Form", "Argument_", "+_", "'\\\\'", ".", " ", "Thi", "s", " ", "argu", "ment", " ", "has", " ", "alr", "ead", "y", " ", "bee", "n", " ", "defin", "ed", " ", "in", " ", "the", " ", "configura", "tion", " ", "file", ".", " ", "Ple", "ase", " ", "ensure", " ", "tha", "t", " ", "all", " ", "'_", "+_", "'", "argu", "ment", "s", " ", "are", " ", "unique", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "repeated", "Short", "Form", "Argument_", "(_", "self_", ",_", "node", "Id_", ",_", "long", "Form", "Argument_", ",_", "short", "Form", "Argument_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Repeat", "ed", " ", "argu", "ment", " ", "in", " ", "the", " ", "pipeline", " ", "configura", "tion", " ", "file", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "pipeline", " ", "configura", "tion", " ", "file", " ", "contain", "s", " ", "a", " ", "definit", "ion", " ", "for", " ", "a", " ", "graph", " ", "node", " ", "with", " ", "ID", " ", "\\\\''_", "+_", "node", "Id_", "+_", "'\\\\'", " ", "whi", "ch", " ", "defin", "es", " ", "the", " ", "'_", "+_", "'", "short", " ", "form", " ", "argu", "ment", " ", "\\\\''_", "+_", "short", "Form", "Argument_", "+_", "'\\\\'", " ", "associate", "d", " ", "with", " ", "the", " ", "long", " ", "form", " ", "argu", "ment", " ", "\\\\''_", "+_", "long", "Form", "Argument_", "+_", "'\\\\'", ".", " ", "Thi", "s", " ", "argu", "ment", " ", "has", " ", "'_", "+_", "'", "alr", "ead", "y", " ", "bee", "n", " ", "defin", "ed", " ", "in", " ", "the", " ", "configura", "tion", " ", "file", ".", " ", "Ple", "ase", " ", "ensure", " ", "tha", "t", " ", "all", " ", "argu", "ment", "s", " ", "are", " ", "unique", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "no", "Short", "Form", "Argument_", "(_", "self_", ",_", "node", "Id_", ",_", "long", "Form", "Argument_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "No", " ", "defin", "ed", " ", "short", " ", "form", " ", "argu", "ment", " ", "in", " ", "the", " ", "pipeline", " ", "configura", "tion", " ", "file", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "pipeline", " ", "configura", "tion", " ", "file", " ", "contain", "s", " ", "a", " ", "definit", "ion", " ", "for", " ", "a", " ", "graph", " ", "node", " ", "with", " ", "ID", " ", "\\\\''_", "+_", "node", "Id_", "+_", "'\\\\'", " ", "whi", "ch", " ", "defin", "es", " ", "the", " ", "'_", "+_", "'", "long", " ", "form", " ", "argu", "ment", " ", "\\\\''_", "+_", "long", "Form", "Argument_", "+_", "'\\\\'", ".", " ", "There", " ", "is", " ", "no", " ", "short", " ", "form", " ", "argu", "ment", " ", "associate", "d", " ", "with", " ", "this", ",", " ", "how", "ever", ".", " ", "Ple", "ase", " ", "ensure", " ", "tha", "t", " ", "all", " ", "'_", "+_", "'", "nodes", " ", "in", " ", "the", " ", "configura", "tion", " ", "file", " ", "defini", "ng", " ", "argu", "ment", "s", " ", "contain", " ", "bot", "h", " ", "a", " ", "short", " ", "and", " ", "long", " ", "form", " ", "version", " ", "of", " ", "the", " ", "argu", "ment", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "no", "Long", "Form", "Argument_", "(_", "self_", ",_", "node", "Id_", ",_", "short", "Form", "Argument_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "No", " ", "defin", "ed", " ", "long", " ", "form", " ", "argu", "ment", " ", "in", " ", "the", " ", "pipeline", " ", "configura", "tion", " ", "file", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "pipeline", " ", "configura", "tion", " ", "file", " ", "contain", "s", " ", "a", " ", "definit", "ion", " ", "for", " ", "a", " ", "graph", " ", "node", " ", "with", " ", "ID", " ", "\\\\''_", "+_", "node", "Id_", "+_", "'\\\\'", " ", "whi", "ch", " ", "defin", "es", " ", "the", " ", "'_", "+_", "'", "short", " ", "form", " ", "argu", "ment", " ", "\\\\''_", "+_", "short", "Form", "Argument_", "+_", "'\\\\'", ".", " ", "There", " ", "is", " ", "no", " ", "long", " ", "form", " ", "argu", "ment", " ", "associate", "d", " ", "with", " ", "this", ",", " ", "how", "ever", ".", " ", "Ple", "ase", " ", "ensure", " ", "tha", "t", " ", "all", " ", "'_", "+_", "'", "nodes", " ", "in", " ", "the", " ", "configura", "tion", " ", "file", " ", "defini", "ng", " ", "argu", "ment", "s", " ", "contain", " ", "bot", "h", " ", "a", " ", "short", " ", "and", " ", "long", " ", "form", " ", "version", " ", "of", " ", "the", " ", "argu", "ment", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "confl", "ict", "With", "G", "kno", "Arguments_", "(_", "self_", ",_", "long", "Form", "Argument_", ",_", "short", "Form", "Argument_", ",_", "is", "Long", "Form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Pipe", "line", " ", "argu", "ment", " ", "confl", "icts", " ", "with", " ", "a", " ", "gk", "no", " ", "argu", "ment", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "long", " ", "form", " ", "argu", "ment", " ", "confl", "icts", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "is", "Long", "Form_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "pipeline", " ", "argu", "ment", " ", "\\\\''_", "+_", "long", "Form", "Argument_", "+_", "'\\\\'", " ", "is", " ", "als", "o", " ", "a", " ", "gk", "no", " ", "argu", "ment", ".", " ", "Ple", "ase", " ", "modif", "y", " ", "the", " ", "pipeline", " ", "configura", "tion", " ", "'_", "+_", "'", "file", " ", "suc", "h", " ", "tha", "t", " ", "all", " ", "argu", "ment", "s", " ", "are", " ", "unique", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "a", " ", "short", " ", "form", " ", "argu", "ment", " ", "confl", "icts", "._", "\\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 ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "pipeline", " ", "argu", "ment", " ", "\\\\''_", "+_", "long", "Form", "Argument_", "+_", "'\\\\'", " ", "has", " ", "the", " ", "short", " ", "form", " ", "\\\\''_", "+_", "short", "Form", "Argument_", "+_", "'\\\\'", ".", " ", "Thi", "s", " ", "short", " ", "form", " ", "is", " ", "'_", "+_", "'", "shared", " ", "with", " ", "the", " ", "short", " ", "form", " ", "version", " ", "of", " ", "a", " ", "gk", "no", " ", "argu", "ment", ".", " ", "Ple", "ase", " ", "modif", "y", " ", "the", " ", "pipeline", " ", "configura", "tion", " ", "file", " ", "suc", "h", " ", "tha", "t", " ", "all", " ", "argu", "ment", "s", " ", "(", "bot", "h", " ", "the", " ", "'_", "+_", "'", "long", " ", "and", " ", "short", " ", "forms", " ", "are", " ", "unique", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Write", " ", "out", " ", "the", " ", "error", " ", "and", " ", "terminate", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "node", "Id", "Is", "Task", "ID_", "(_", "self_", ",_", "name_", ",_", "node_", ",_", "id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Node", " ", "ID", " ", "confl", "icts", " ", "with", " ", "a", " ", "task", " ", "ID", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "configura", "tion", " ", "file", " ", "for", " ", "the", " ", "\\\\''_", "+_", "name_", "+_", "'\\\\'", " ", "pipeline", " ", "contain", "s", " ", "a", " ", "node", " ", "in", " ", "the", " ", "\\\\''_", "+_", "node_", "+_", "'\\\\'", " ", "section", " ", "with", " ", "the", " ", "'_", "+_", "'", "id", " ", "\\\\''_", "+_", "id_", "+_", "'\\\\'", ".", " ", "Thi", "s", " ", "is", " ", "als", "o", " ", "the", " ", "name", " ", "of", " ", "a", " ", "task", " ", "in", " ", "the", " ", "pipeline", ".", " ", "All", " ", "the", " ", "task", " ", "names", " ", "and", " ", "node", " ", "ids", " ", "within", " ", "a", " ", "single", " ", "configura", "tion", " ", "'_", "+_", "'", "file", " ", "must", " ", "be", " ", "unique", ".", " ", "Ple", "ase", " ", "amend", " ", "the", " ", "configura", "tion", " ", "file", " ", "to", " ", "make", " ", "sure", " ", "tha", "t", " ", "all", " ", "of", " ", "the", " ", "ids", " ", "are", " ", "unique", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "invalid", "Gree", "dy", "Argument_", "(_", "self_", ",_", "name_", ",_", "task_", ",_", "tool_", ",_", "argument_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Inva", "lid", " ", "greedy", " ", "argu", "ment", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "configura", "tion", " ", "file", " ", "for", " ", "the", " ", "\\\\''_", "+_", "name_", "+_", "'\\\\'", " ", "pipeline", " ", "contain", "s", " ", "informati", "on", " ", "for", " ", "the", " ", "task", " ", "\\\\''_", "+_", "task_", "+_", "'\\\\'", ",", " ", "whi", "ch", " ", "'_", "+_", "'", "use", "s", " ", "the", " ", "tool", " ", "\\\\''_", "+_", "tool_", "+_", "'\\\\'", ".", " ", "The", " ", "configura", "tion", " ", "file", " ", "identifi", "es", " ", "the", " ", "argu", "ment", " ", "\\\\''_", "+_", "argument_", "+_", "'\\\\'", " ", "as", " ", "bei", "ng", " ", "greedy", ",", " ", "but", " ", "this", " ", "argu", "ment", " ", "'_", "+_", "'", "is", " ", "not", " ", "a", " ", "valid", " ", "argu", "ment", " ", "for", " ", "the", " ", "tool", ".", " ", "Ple", "ase", " ", "ensure", " ", "tha", "t", " ", "the", " ", "correct", " ", "argu", "ment", " ", "has", " ", "bee", "n", " ", "supplie", "d", " ", "as", " ", "a", " ", "greedy", " ", "argu", "ment", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "greedy", "Sing", "le", "Value", "Argument_", "(_", "self_", ",_", "name_", ",_", "task_", ",_", "tool_", ",_", "argument_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Inva", "lid", " ", "greedy", " ", "argu", "ment", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "configura", "tion", " ", "file", " ", "for", " ", "the", " ", "\\\\''_", "+_", "name_", "+_", "'\\\\'", " ", "pipeline", " ", "contain", "s", " ", "informati", "on", " ", "for", " ", "the", " ", "task", " ", "\\\\''_", "+_", "task_", "+_", "'\\\\'", ",", " ", "whi", "ch", " ", "'_", "+_", "'", "use", "s", " ", "the", " ", "tool", " ", "\\\\''_", "+_", "tool_", "+_", "'\\\\'", ".", " ", "The", " ", "configura", "tion", " ", "file", " ", "identifi", "es", " ", "the", " ", "argu", "ment", " ", "\\\\''_", "+_", "argument_", "+_", "'\\\\'", " ", "as", " ", "bei", "ng", " ", "greedy", ",", " ", "but", " ", "this", " ", "argu", "ment", " ", "'_", "+_", "'", "is", " ", "not", " ", "liste", "d", " ", "as", " ", "accept", "ing", " ", "multiple", " ", "values", " ", "in", " ", "the", " ", "tool", " ", "configura", "tion", " ", "file", ".", " ", "Ple", "ase", " ", "ensure", " ", "tha", "t", " ", "the", " ", "correct", " ", "argu", "ment", " ", "has", " ", "bee", "n", " ", "supplie", "d", " ", "as", " ", "'_", "+_", "'", "a", " ", "greedy", " ", "argu", "ment", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "terminate", "Cons", "oli", "date", "Error_", "(_", "self_", ",_", "name_", ",_", "task_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Inva", "lid", " ", "termination", " ", "instruct", "ion", "s", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "configura", "tion", " ", "file", " ", "for", " ", "the", " ", "\\\\''_", "+_", "name_", "+_", "'\\\\'", " ", "pipeline", " ", "contain", "s", " ", "informati", "on", " ", "for", " ", "the", " ", "task", " ", "\\\\''_", "+_", "task_", "+_", "'\\\\'", ".", " ", "Thi", "s", " ", "task", " ", "has", " ", "'_", "+_", "'", "the", " ", "attribute", " ", "\\\\'", "terminate", " ", "if", " ", "no", " ", "consolidat", "ion", "\\\\'", " ", "set", ",", " ", "but", " ", "this", " ", "attribute", " ", "is", " ", "only", " ", "valid", " ", "for", " ", "task", "s", " ", "tha", "t", " ", "als", "o", " ", "have", " ", "\\\\'", "consolidat", "e", " ", "divisions", "\\\\'", " ", "set", " ", "'_", "+_", "'", "to", " ", "true", ",", " ", "whi", "ch", " ", "this", " ", "task", " ", "doe", "s", " ", "not", ".", " ", "Ple", "ase", " ", "correct", " ", "the", " ", "error", "s", " ", "in", " ", "the", " ", "pipeline", " ", "configura", "tion", " ", "file", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "invalid", "Stream", "Set_", "(_", "self_", ",_", "pipeline_", ",_", "task_", ",_", "name_", ",_", "valid", "Sets_", ",_", "is", "Input_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "'", "input", "'_", "if_", "is", "Input_", "else_", "'", "output", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "Inva", "lid", " ", "'_", "+_", "text_", "+_", "'", " ", "stream", "ing", " ", "instruct", "ion", " ", "set", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "configura", "tion", " ", "file", " ", "for", " ", "the", " ", "\\\\''_", "+_", "pipeline_", "+_", "'\\\\'", " ", "pipeline", " ", "contain", "s", " ", "informati", "on", " ", "for", " ", "the", " ", "task", " ", "\\\\''_", "+_", "task_", "+_", "'\\\\'", ".", " ", "Thi", "s", " ", "task", " ", "'_", "+_", "'", "deal", "s", " ", "with", " ", "stream", "ing", " ", "files", " ", "and", ",", " ", "in", " ", "partic", "ular", ",", " ", "the", " ", "'_", "+_", "text_", "+_", "'", " ", "stream", " ", "has", " ", "the", " ", "instruct", "ion", " ", "set", " ", "\\\\''_", "+_", "name_", "+_", "'\\\\'", " ", "specified", ".", " ", "Thi", "s", " ", "is", " ", "an", " ", "invalid", " ", "'_", "+_", "'", "set", " ", "of", " ", "instruct", "ion", "s", ";", " ", "the", " ", "valid", " ", "values", " ", "are", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'\\\\", "t", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "set", "Name_", "in_", "valid", "Sets_", ":_", "self_", "._", "text_", "._", "append_", "(_", "'\\\\", "t", "'_", "+_", "set", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "invalid", "Node", "In", "Terminati", "on_", "(_", "self_", ",_", "name_", ",_", "node", "Id_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Inva", "lid", " ", "node", " ", "Id", " ", "in", " ", "the", " ", "\\\\'", "terminate", " ", "pipeline", "\\\\'", " ", "section", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "configura", "tion", " ", "file", " ", "for", " ", "the", " ", "\\\\''_", "+_", "name_", "+_", "'\\\\'", " ", "pipeline", " ", "contain", "s", " ", "informati", "on", " ", "in", " ", "the", " ", "\\\\'", "terminate", " ", "pipeline", "\\\\'", " ", "section", " ", "'_", "+_", "'", "tha", "t", " ", "descri", "bes", " ", "condition", "s", " ", "and", " ", "instruct", "ion", "s", " ", "for", " ", "creati", "ng", " ", "a", " ", "pipeline", " ", "tha", "t", " ", "doe", "sn", "\\\\'", "t", " ", "use", " ", "all", " ", "of", " ", "the", " ", "defin", "ed", " ", "task", "s", ".", " ", "In", " ", "the", " ", "\\\\'", "replace", " ", "nodes", "\\\\'", " ", "'_", "+_", "'", "section", ",", " ", "one", " ", "of", " ", "the", " ", "\\\\''_", "+_", "text_", "+_", "'\\\\'", " ", "nodes", " ", "('_", "+_", "node", "Id_", "+_", "')", " ", "is", " ", "invalid", " ", "for", " ", "the", " ", "pipeline", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "invalid", "Node", "In", "Argument_", "(_", "self_", ",_", "pipeline_", ",_", "argument_", ",_", "address_", ",_", "category_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Inva", "lid", " ", "node", " ", "address", " ", "supplie", "d", " ", "with", " ", "argu", "ment", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "configura", "tion", " ", "file", " ", "for", " ", "the", " ", "\\\\''_", "+_", "pipeline_", "+_", "'\\\\'", " ", "pipeline", " ", "contain", "s", " ", "informati", "on", " ", "in", " ", "the", " ", "\\\\''_", "+_", "category_", "+_", "'\\\\'", " ", "section", " ", "'_", "+_", "'", "of", " ", "\\\\'", "argu", "ment", "s", "\\\\'", " ", "for", " ", "the", " ", "argu", "ment", " ", "\\\\''_", "+_", "argument_", "+_", "'\\\\'", ".", " ", "Thi", "s", " ", "argu", "ment", " ", "is", " ", "defin", "ed", " ", "as", " ", "pointi", "ng", " ", "to", " ", "the", " ", "node", " ", "with", " ", "address", " ", "\\\\''_", "+_", "address_", "+_", "'\\\\'", ",", " ", "but", " ", "this", " ", "address", " ", "doe", "s", " ", "not", " ", "point", " ", "to", " ", "a", " ", "valid", " ", "node", " ", "in", " ", "the", " ", "configura", "tion", " ", "file", ".", " ", "Ple", "ase", " ", "ensure", " ", "tha", "t", " ", "the", " ", "node", " ", "address", " ", "provided", " ", "'_", "+_", "'", "with", " ", "the", " ", "argu", "ment", " ", "is", " ", "the", " ", "ID", " ", "of", " ", "one", " ", "of", " ", "the", " ", "nodes", " ", "in", " ", "the", " ", "unique", " ", "or", " ", "shared", " ", "nodes", " ", "of", " ", "the", " ", "configura", "tion", " ", "file", ".", " ", "Not", "e", " ", "tha", "t", " ", "if", " ", "the", " ", "pipeline", " ", "contain", "s", " ", "'_", "+_", "'", "task", "s", " ", "tha", "t", " ", "are", " ", "them", "sel", "ves", " ", "pipeline", "s", ",", " ", "this", " ", "address", " ", "coul", "d", " ", "be", " ", "pointi", "ng", " ", "to", " ", "a", " ", "node", " ", "in", " ", "one", " ", "of", " ", "the", " ", "nest", "ed", " ", "configura", "tion", " ", "files", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "repeated", "Long", "Form", "Argument_", "(_", "self_", ",_", "help", "Info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Repeat", "ed", " ", "long", " ", "form", " ", "argu", "ment", " ", "in", " ", "pipeline", " ", "configura", "tion", " ", "file", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "configura", "tion", " ", "file", " ", "for", " ", "pipeline", " ", "\\\\''_", "+_", "help", "Info_", "[_", "0_", "]_", "+_", "'\\\\'", " ", "contain", "s", " ", "informati", "on", " ", "for", " ", "a", " ", "number", " ", "of", " ", "pipeline", " ", "argu", "ment", "s", ".", " ", "The", " ", "\\\\''_", "+_", "help", "Info_", "[_", "1_", "]_", "+_", "'\\\\'", " ", "section", " ", "contain", "s", " ", "informati", "on", " ", "for", " ", "the", " ", "argu", "ment", " ", "\\\\''_", "+_", "help", "Info_", "[_", "2_", "]_", "+_", "'\\\\'", " ", "but", " ", "this", " ", "long", " ", "form", " ", "argu", "ment", " ", "has", " ", "alr", "ead", "y", " ", "bee", "n", " ", "defin", "ed", " ", "'_", "+_", "'", "in", " ", "the", " ", "configura", "tion", " ", "file", ".", " ", "Ple", "ase", " ", "ensure", " ", "tha", "t", " ", "all", " ", "argu", "ment", "s", " ", "in", " ", "the", " ", "configura", "tion", " ", "file", " ", "are", " ", "unique", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "repeated", "Short", "Form", "Argument_", "(_", "self_", ",_", "help", "Info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Repeat", "ed", " ", "short", " ", "form", " ", "argu", "ment", " ", "in", " ", "pipeline", " ", "configura", "tion", " ", "file", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "configura", "tion", " ", "file", " ", "for", " ", "pipeline", " ", "\\\\''_", "+_", "help", "Info_", "[_", "0_", "]_", "+_", "'\\\\'", " ", "contain", "s", " ", "informati", "on", " ", "for", " ", "a", " ", "number", " ", "of", " ", "pipeline", " ", "argu", "ment", "s", ".", " ", "The", " ", "\\\\''_", "+_", "help", "Info_", "[_", "1_", "]_", "+_", "'\\\\'", " ", "section", " ", "contain", "s", " ", "informati", "on", " ", "for", " ", "the", " ", "argu", "ment", " ", "\\\\''_", "+_", "help", "Info_", "[_", "2_", "]_", "+_", "'\\\\'", " ", "but", " ", "this", " ", "short", " ", "form", " ", "argu", "ment", " ", "has", " ", "alr", "ead", "y", " ", "bee", "n", " ", "defin", "ed", " ", "'_", "+_", "'", "in", " ", "the", " ", "configura", "tion", " ", "file", ".", " ", "Ple", "ase", " ", "ensure", " ", "tha", "t", " ", "all", " ", "argu", "ment", "s", " ", "in", " ", "the", " ", "configura", "tion", " ", "file", " ", "are", " ", "unique", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "argu", "ment", "Is", "Task_", "(_", "self_", ",_", "long", "Form", "Argument_", ",_", "short", "Form", "Argument_", ",_", "is", "Long", "Form_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "'", "long", "'_", "if_", "is", "Long", "Form_", "else_", "'", "short", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "A", " ", "pipeline", " ", "argu", "ment", " ", "share", "s", " ", "a", " ", "name", " ", "with", " ", "a", " ", "pipeline", " ", "task", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "user", " ", "is", " ", "permit", "ted", " ", "to", " ", "defin", "e", " ", "the", " ", "name", " ", "of", " ", "a", " ", "pipeline", " ", "task", " ", "on", " ", "the", " ", "command", " ", "line", " ", "in", " ", "order", " ", "to", " ", "set", " ", "parameter", "s", " ", "for", " ", "tha", "t", " ", "task", " ", "'_", "+_", "'", "tha", "t", " ", "have", " ", "not", " ", "bee", "n", " ", "give", "n", " ", "specific", " ", "pipeline", " ", "argu", "ment", "s", ".", " ", "In", " ", "order", " ", "for", " ", "this", " ", "to", " ", "work", ",", " ", "no", " ", "argu", "ment", "s", " ", "for", " ", "the", " ", "pipeline", " ", "may", " ", "share", " ", "a", " ", "name", " ", "with", " ", "a", " ", "'_", "+_", "'", "pipeline", " ", "task", ".", " ", "There", " ", "is", " ", "a", " ", "defin", "ed", " ", "pipeline", " ", "argu", "ment", " ", "\\\\''_", "+_", "long", "Form", "Argument_", "+_", "'", " ", "('_", "+_", "short", "Form", "Argument_", "+_", "')", "\\\\'", ",", " ", "where", " ", "the", " ", "'_", "+_", "text_", "+_", "'", " ", "'_", "+_", "'", "form", " ", "of", " ", "the", " ", "argu", "ment", " ", "is", " ", "the", " ", "name", " ", "of", " ", "a", " ", "pipeline", " ", "task", ".", " ", "Ple", "ase", " ", "change", " ", "the", " ", "name", " ", "of", " ", "the", " ", "pipeline", " ", "task", " ", "or", " ", "the", " ", "argu", "ment", " ", "to", " ", "remove", " ", "this", " ", "confl", "ict", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "missi", "ng", "Node", "Id", "For", "Pipe", "line", "Task_", "(_", "self_", ",_", "pipeline_", ",_", "node", "Type_", ",_", "node", "Id_", ",_", "task_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Inva", "lid", " ", "informati", "on", " ", "in", " ", "configura", "tion", " ", "file", " ", "node", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "configura", "tion", " ", "file", " ", "for", " ", "the", " ", "\\\\''_", "+_", "pipeline_", "+_", "'\\\\'", " ", "pipeline", " ", "contain", "s", " ", "a", " ", "node", " ", "with", " ", "id", " ", "\\\\''_", "+_", "node", "Id_", "+_", "'\\\\'", " ", "in", " ", "the", " ", "\\\\''_", "+_", "node", "Type_", "+_", "'", " ", "graph", " ", "nodes", "\\\\'", " ", "section", ".", " ", "Thi", "s", " ", "node", " ", "connects", " ", "with", " ", "the", " ", "task", " ", "\\\\''_", "+_", "task_", "+_", "'\\\\'", ",", " ", "whi", "ch", " ", "is", " ", "a", " ", "task", " ", "tha", "t", " ", "its", "elf", " ", "runs", " ", "a", " ", "pipeline", ".", " ", "'_", "+_", "'", "In", " ", "this", " ", "case", ",", " ", "the", " ", "node", " ", "id", " ", "of", " ", "the", " ", "node", " ", "in", " ", "the", " ", "associate", "d", " ", "pipeline", " ", "need", "s", " ", "to", " ", "supplie", "d", " ", "(", "and", " ", "not", " ", "task", " ", "argu", "ment", " ", "informati", "on", ").", " ", "The", " ", "node", " ", "id", " ", "'_", "+_", "'", "has", " ", "not", " ", "bee", "n", " ", "supplie", "d", " ", "in", " ", "this", " ", "case", ".", " ", "Ple", "ase", " ", "check", " ", "the", " ", "configura", "tion", " ", "file", " ", "and", " ", "ensure", " ", "tha", "t", " ", "the", " ", "correct", " ", "informati", "on", " ", "is", " ", "provided", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "invalid", "Node", "For", "Exter", "nal", "Pipeline_", "(_", "self_", ",_", "pipeline_", ",_", "node", "Type_", ",_", "node", "Id_", ",_", "task_", ",_", "external", "Pipeline_", ",_", "external", "Node", "Id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "external", "Pipeline_", ":_", "external", "Pipeline_", "=_", "'", "bob", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "Inva", "lid", " ", "external", " ", "node", " ", "id", " ", "in", " ", "configura", "tion", " ", "file", " ", "node", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "configura", "tion", " ", "file", " ", "for", " ", "the", " ", "\\\\''_", "+_", "pipeline_", "+_", "'\\\\'", " ", "pipeline", " ", "contain", "s", " ", "a", " ", "node", " ", "with", " ", "id", " ", "\\\\''_", "+_", "node", "Id_", "+_", "'\\\\'", " ", "in", " ", "the", " ", "\\\\''_", "+_", "node", "Type_", "+_", "'", " ", "graph", " ", "nodes", "\\\\'", " ", "section", ".", " ", "Thi", "s", " ", "node", " ", "connects", " ", "with", " ", "the", " ", "task", " ", "\\\\''_", "+_", "task_", "+_", "'\\\\'", ",", " ", "whi", "ch", " ", "is", " ", "a", " ", "task", " ", "tha", "t", " ", "its", "elf", " ", "runs", " ", "the", " ", "pipeline", " ", "'_", "+_", "'\\\\''_", "+_", "external", "Pipeline_", "+_", "'\\\\'", ".", " ", "The", " ", "node", " ", "id", " ", "\\\\''_", "+_", "external", "Node", "Id_", "+_", "'\\\\'", " ", "is", " ", "supplie", "d", " ", "as", " ", "the", " ", "node", " ", "within", " ", "the", " ", "external", " ", "pipeline", " ", "with", " ", "whi", "ch", " ", "'_", "+_", "'", "to", " ", "connect", ",", " ", "but", " ", "this", " ", "is", " ", "not", " ", "a", " ", "valid", " ", "node", " ", "for", " ", "the", " ", "pipeline", ".", " ", "Ple", "ase", " ", "check", " ", "tha", "t", " ", "all", " ", "informati", "on", " ", "in", " ", "the", " ", "configura", "tion", " ", "file", " ", "is", " ", "correct", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "external", "Node", "For", "Task_", "(_", "self_", ",_", "pipeline_", ",_", "node", "Type_", ",_", "node", "Id_", ",_", "task_", ",_", "external", "Node", "Id_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Inva", "lid", " ", "external", " ", "node", " ", "id", " ", "in", " ", "configura", "tion", " ", "file", " ", "node", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "configura", "tion", " ", "file", " ", "for", " ", "the", " ", "\\\\''_", "+_", "pipeline_", "+_", "'\\\\'", " ", "pipeline", " ", "contain", "s", " ", "a", " ", "node", " ", "with", " ", "id", " ", "\\\\''_", "+_", "node", "Id_", "+_", "'\\\\'", " ", "in", " ", "the", " ", "\\\\''_", "+_", "node", "Type_", "+_", "'", " ", "graph", " ", "nodes", "\\\\'", " ", "section", ".", " ", "Thi", "s", " ", "node", " ", "connects", " ", "with", " ", "the", " ", "task", " ", "\\\\''_", "+_", "task_", "+_", "'\\\\'", ",", " ", "whi", "ch", " ", "is", " ", "a", " ", "task", " ", "tha", "t", " ", "runs", " ", "a", " ", "tool", ".", " ", "Whe", "n", " ", "this", " ", "'_", "+_", "'", "is", " ", "the", " ", "case", ",", " ", "the", " ", "\\\\'", "task", " ", "argu", "ment", "\\\\'", " ", "field", " ", "must", " ", "als", "o", " ", "be", " ", "presen", "t", " ", "to", " ", "defin", "e", " ", "whi", "ch", " ", "of", " ", "the", " ", "tool", "s", " ", "argu", "ment", "s", " ", "this", " ", "node", " ", "connects", " ", "with", ".", " ", "Ins", "tea", "d", ",", " ", "'_", "+_", "'", "the", " ", "\\\\'", "node", " ", "id", "\\\\'", " ", "field", " ", "has", " ", "bee", "n", " ", "provided", ".", " ", "Thi", "s", " ", "is", " ", "only", " ", "valid", " ", "for", " ", "task", "s", " ", "tha", "t", " ", "them", "sel", "ves", " ", "run", " ", "pipeline", "s", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "invalid", "Task", "In", "Node_", "(_", "self_", ",_", "pipeline_", ",_", "node", "Type_", ",_", "node", "Id_", ",_", "task_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Inva", "lid", " ", "task", " ", "in", " ", "configura", "tion", " ", "file", " ", "node", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "configura", "tion", " ", "file", " ", "for", " ", "the", " ", "\\\\''_", "+_", "pipeline_", "+_", "'\\\\'", " ", "pipeline", " ", "contain", "s", " ", "a", " ", "node", " ", "with", " ", "id", " ", "\\\\''_", "+_", "node", "Id_", "+_", "'\\\\'", " ", "in", " ", "the", " ", "\\\\''_", "+_", "node", "Type_", "+_", "'", " ", "graph", " ", "nodes", "\\\\'", " ", "section", ".", " ", "With", "in", " ", "this", " ", "node", ",", " ", "the", " ", "task", " ", "\\\\''_", "+_", "task_", "+_", "'\\\\'", " ", "is", " ", "used", ",", " ", "but", " ", "this", " ", "task", " ", "has", " ", "not", " ", "bee", "n", " ", "defin", "ed", " ", "in", " ", "the", " ", "'_", "+_", "'\\\\'", "pipeline", " ", "task", "s", "\\\\'", " ", "section", " ", "of", " ", "the", " ", "configura", "tion", " ", "file", " ", "and", " ", "consequ", "ent", "ly", " ", "is", " ", "not", " ", "valid", ".", " ", "Ple", "ase", " ", "check", " ", "tha", "t", " ", "all", " ", "task", "s", " ", "in", " ", "the", " ", "configura", "tion", " ", "'_", "+_", "'", "file", " ", "are", " ", "valid", " ", "for", " ", "the", " ", "pipeline", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "invalid", "Tool", "Argument_", "(_", "self_", ",_", "pipeline_", ",_", "node", "Type_", ",_", "node", "Id_", ",_", "task_", ",_", "tool_", ",_", "argument_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Inva", "lid", " ", "tool", " ", "argu", "ment", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "configura", "tion", " ", "file", " ", "for", " ", "the", " ", "\\\\''_", "+_", "pipeline_", "+_", "'\\\\'", " ", "pipeline", " ", "contain", "s", " ", "a", " ", "node", " ", "with", " ", "id", " ", "\\\\''_", "+_", "node", "Id_", "+_", "'\\\\'", " ", "in", " ", "the", " ", "\\\\''_", "+_", "node", "Type_", "+_", "'", " ", "graph", " ", "nodes", "\\\\'", " ", "section", ".", " ", "With", "in", " ", "this", " ", "node", ",", " ", "the", " ", "task", " ", "\\\\''_", "+_", "task_", "+_", "'\\\\'", " ", "whi", "ch", " ", "use", "s", " ", "the", " ", "tool", " ", "\\\\''_", "+_", "tool_", "+_", "'\\\\'", " ", "is", " ", "associate", "d", " ", "'_", "+_", "'", "with", " ", "the", " ", "argu", "ment", " ", "\\\\''_", "+_", "argument_", "+_", "'\\\\'", ",", " ", "but", " ", "this", " ", "argu", "ment", " ", "is", " ", "not", " ", "valid", " ", "for", " ", "the", " ", "tool", ".", " ", "Ple", "ase", " ", "check", " ", "tha", "t", " ", "all", " ", "of", " ", "the", " ", "tool", " ", "argu", "ment", "s", " ", "'_", "+_", "'", "in", " ", "the", " ", "pipeline", " ", "configura", "tion", " ", "file", " ", "are", " ", "valid", " ", "for", " ", "the", " ", "tool", "s", " ", "the", "y", " ", "are", " ", "linked", " ", "to", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "repeated", "Node", "Id_", "(_", "self_", ",_", "help", "Info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Repeat", "ed", " ", "pipeline", " ", "node", " ", "id", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "configura", "tion", " ", "file", " ", "for", " ", "the", " ", "pipeline", " ", "\\\\''_", "+_", "help", "Info_", "[_", "0_", "]_", "+_", "'\\\\'", " ", "contain", "s", " ", "a", " ", "node", " ", "in", " ", "the", " ", "\\\\''_", "+_", "help", "Info_", "[_", "1_", "]_", "+_", "'\\\\'", " ", "section", " ", "'_", "+_", "'", "with", " ", "the", " ", "same", " ", "id", " ", "('_", "+_", "help", "Info_", "[_", "2_", "]_", "+_", "')", " ", "as", " ", "anot", "her", " ", "node", " ", "in", " ", "the", " ", "pipeline", ".", " ", "All", " ", "nodes", " ", "must", " ", "have", " ", "unique", " ", "ids", " ", "in", " ", "order", " ", "to", " ", "construct", " ", "the", " ", "'_", "+_", "'", "pipeline", " ", "graph", ".", " ", "Ple", "ase", " ", "ensure", " ", "tha", "t", " ", "all", " ", "nodes", " ", "defin", "ed", " ", "in", " ", "the", " ", "configura", "tion", " ", "file", " ", "are", " ", "unique", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "node", "Id", "Is", "Task", "Id_", "(_", "self_", ",_", "node", "Type_", ",_", "help", "Info_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Configura", "tion", " ", "file", " ", "node", " ", "has", " ", "the", " ", "same", " ", "id", " ", "as", " ", "a", " ", "task", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "A", " ", "node", " ", "in", " ", "the", " ", "\\\\''_", "+_", "help", "Info_", "[_", "1_", "]_", "+_", "'\\\\'", " ", "section", " ", "of", " ", "the", " ", "pipeline", " ", "configura", "tion", " ", "file", " ", "for", " ", "pipeline", " ", "\\\\''_", "+_", "help", "Info_", "[_", "0_", "]_", "+_", "'\\\\'", " ", "has", " ", "the", " ", "id", " ", "\\\\''_", "+_", "help", "Info_", "[_", "2_", "]_", "+_", "'\\\\'", ".", " ", "Thi", "s", " ", "is", " ", "the", " ", "same", " ", "id", " ", "as", " ", "a", " ", "task", " ", "defin", "ed", " ", "in", " ", "the", " ", "\\\\'", "pipeline", " ", "task", "s", "\\\\'", " ", "section", ".", " ", "All", " ", "the", " ", "node", " ", "ids", " ", "'_", "+_", "'", "in", " ", "the", " ", "configura", "tion", " ", "file", " ", "(", "acro", "ss", " ", "all", " ", "task", ",", " ", "unique", " ", "nodes", " ", "and", " ", "shared", " ", "nodes", ")", " ", "must", " ", "be", " ", "unique", ".", " ", "Ple", "ase", " ", "update", " ", "the", " ", "ids", " ", "to", " ", "ensure", " ", "tha", "t", " ", "the", "y", " ", "'_", "+_", "'", "are", " ", "all", " ", "unique", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "invalid", "Node", "Connection_", "(_", "self_", ",_", "source_", ",_", "target_", ",_", "text_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Error", " ", "with", " ", "node", " ", "connections", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "In", " ", "the", " ", "\\\\'", "connect", " ", "nodes", "\\\\'", " ", "section", " ", "of", " ", "the", " ", "pipeline", " ", "configura", "tion", " ", "file", ",", " ", "a", " ", "connecti", "on", " ", "is", " ", "defin", "ed", " ", "bet", "ween", " ", "the", " ", "nodes", " ", "\\\\''_", "+_", "source_", "+_", "'\\\\'", " ", "and", " ", "\\\\''_", "+_", "target_", "+_", "'\\\\'", ".", " ", "The", " ", "'_", "+_", "text_", "+_", "'", " ", "node", " ", "is", " ", "not", " ", "a", " ", "valid", " ", "node", " ", "in", " ", "the", " ", "graph", ".", " ", "Ple", "ase", " ", "ensure", " ", "tha", "t", " ", "all", " ", "of", " ", "the", " ", "connections", " ", "'_", "+_", "'", "are", " ", "defin", "ed", " ", "bet", "ween", " ", "a", " ", "valid", " ", "pair", " ", "of", " ", "graph", " ", "nodes", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "no", "Output", "Stream", "Argument_", "(_", "self_", ",_", "task_", ",_", "tool_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Error", " ", "with", " ", "output", " ", "stream", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "task", " ", "\\\\''_", "+_", "task_", "+_", "'\\\\'", ",", " ", "usi", "ng", " ", "the", " ", "tool", " ", "\\\\''_", "+_", "tool_", "+_", "'\\\\'", " ", "is", " ", "marked", " ", "as", " ", "output", "ting", " ", "to", " ", "a", " ", "stream", " ", "in", " ", "the", " ", "\\\\'", "pipeline", " ", "'_", "+_", "'", "task", "s", "\\\\'", " ", "section", " ", "of", " ", "the", " ", "configura", "tion", " ", "file", ",", " ", "but", " ", "no", " ", "output", " ", "argu", "ment", "s", " ", "are", " ", "identifi", "ed", " ", "with", " ", "stream", "ing", " ", "output", "s", ".", " ", "Ple", "ase", " ", "check", " ", "tha", "t", " ", "this", " ", "task", " ", "is", " ", "'_", "+_", "'", "supposed", " ", "to", " ", "be", " ", "output", "ting", " ", "to", " ", "a", " ", "stream", " ", "and", " ", "if", " ", "so", ",", " ", "ensure", " ", "tha", "t", " ", "one", " ", "of", " ", "the", " ", "output", " ", "argu", "ment", "s", " ", "in", " ", "the", " ", "tool", " ", "configura", "tion", " ", "file", " ", "has", " ", "instruct", "ion", "s", " ", "'_", "+_", "'", "on", " ", "how", " ", "to", " ", "be", " ", "handle", "d", " ", "if", " ", "the", " ", "output", " ", "is", " ", "a", " ", "stream", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "no", "Stream", "Instructions", "_", "(_", "self_", ",_", "task_", ",_", "tool_", ",_", "input", "Task_", ",_", "input", "Tool_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Error", " ", "with", " ", "stream", "ing", " ", "files", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "task", " ", "\\\\''_", "+_", "task_", "+_", "'\\\\'", ",", " ", "usi", "ng", " ", "the", " ", "tool", " ", "\\\\''_", "+_", "tool_", "+_", "'\\\\'", " ", "is", " ", "marked", " ", "as", " ", "output", "ting", " ", "to", " ", "a", " ", "stream", " ", "in", " ", "the", " ", "\\\\'", "pipeline", " ", "'_", "+_", "'", "task", "s", "\\\\'", " ", "section", " ", "of", " ", "the", " ", "configura", "tion", " ", "file", " ", "and", " ", "the", " ", "task", " ", "\\\\''_", "+_", "input", "Task_", "+_", "'\\\\'", ",", " ", "usi", "ng", " ", "the", " ", "tool", " ", "\\\\''_", "+_", "input", "Tool_", "+_", "'\\\\'", " ", "accepts", " ", "the", " ", "stream", " ", "as", " ", "'_", "+_", "'", "input", ".", " ", "There", " ", "are", " ", "no", " ", "input", " ", "argu", "ment", "s", " ", "for", " ", "the", " ", "\\\\''_", "+_", "input", "Task_", "+_", "'\\\\'", " ", "task", " ", "tha", "t", " ", "have", " ", "instruct", "ion", "s", " ", "on", " ", "how", " ", "to", " ", "use", " ", "a", " ", "stream", " ", "as", " ", "input", ".", " ", "Ple", "ase", " ", "check", " ", "'_", "+_", "'", "tha", "t", " ", "the", " ", "correct", " ", "task", " ", "is", " ", "marked", " ", "as", " ", "accept", "ing", " ", "a", " ", "stream", ",", " ", "and", " ", "ensure", " ", "tha", "t", " ", "an", " ", "input", " ", "argu", "ment", " ", "in", " ", "it", "\\\\'", "s", " ", "tool", " ", "configura", "tion", " ", "file", " ", "has", " ", "instruct", "ion", "s", " ", "'_", "+_", "'", "on", " ", "how", " ", "to", " ", "modif", "y", " ", "the", " ", "argu", "ment", " ", "to", " ", "handle", " ", "a", " ", "stream", "ing", " ", "input", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "pipeline", "Errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Initialise", "._", "\\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_", "no", "Node", "Accept", "ing", "Stream_", "(_", "self_", ",_", "task_", ",_", "tool_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "text_", "._", "append_", "(_", "'", "Error", " ", "with", " ", "stream", "ing", " ", "files", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "text_", "._", "append_", "(_", "'", "The", " ", "task", " ", "\\\\''_", "+_", "task_", "+_", "'\\\\'", ",", " ", "usi", "ng", " ", "the", " ", "tool", " ", "\\\\''_", "+_", "tool_", "+_", "'\\\\'", " ", "is", " ", "marked", " ", "as", " ", "output", "ting", " ", "to", " ", "a", " ", "stream", " ", "in", " ", "the", " ", "\\\\'", "pipeline", " ", "'_", "+_", "'", "task", "s", "\\\\'", " ", "section", " ", "of", " ", "the", " ", "configura", "tion", " ", "file", ",", " ", "but", " ", "no", " ", "task", "s", " ", "are", " ", "marked", " ", "as", " ", "accept", "ing", " ", "a", " ", "stream", ".", " ", "Sin", "ce", " ", "a", " ", "task", " ", "is", " ", "output", "ting", " ", "to", " ", "a", " ", "stream", ",", " ", "'_", "+_", "'", "anot", "her", " ", "task", " ", "(", "by", " ", "convention", ",", " ", "the", " ", "next", " ", "task", " ", "in", " ", "the", " ", "list", ")", " ", "must", " ", "be", " ", "able", " ", "to", " ", "accept", " ", "the", " ", "stream", " ", "as", " ", "input", ".", " ", "Thi", "s", " ", "is", " ", "achieve", "d", " ", "by", " ", "inclu", "ding", " ", "the", " ", "'_", "+_", "'\\\\'", "\"", "input", " ", "is", " ", "stream", "\"", " ", ":", " ", "true", "\\\\'", " ", "field", " ", "in", " ", "the", " ", "\\\\'", "pipeline", " ", "task", "s", "\\\\'", " ", "section", " ", "for", " ", "the", " ", "task", " ", "tha", "t", " ", "will", " ", "accept", " ", "a", " ", "stream", "ing", " ", "input", ".", " ", "Ple", "ase", " ", "ensure", " ", "tha", "t", " ", "'_", "+_", "'", "this", " ", "is", " ", "the", " ", "case", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "write", "Formatt", "ed", "Text_", "(_", "self_", "._", "text_", ",_", "error", "Type_", "=_", "'", "error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "errors_", "._", "terminate_", "(_", "self_", "._", "error", "Code_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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nfrom azure.common import AzureMissingResourceHttpError\nfrom collections import namedtuple\nfrom datetime import datetime\nfrom mock import patch\nfrom test_helper import *\n\nfrom azurectl.account.service import AzureAccount\nfrom azurectl.azurectl_exceptions import *\nfrom azurectl.config.parser import Config\nfrom azurectl.instance.data_disk import DataDisk\n\nimport azurectl\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestDataDisk:\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.TestDataDisk", "header": "['module', '___EOS___']", "index": 17 }, { "content": " def setup(self):\n # construct an account\n account = AzureAccount(\n Config(\n region_name='East US 2', filename='../data/config'\n )\n )\n self.service = mock.Mock()\n account.get_management_service = mock.Mock(return_value=self.service)\n account.get_blob_service_host_base = mock.Mock(\n return_value='test.url'\n )\n account.storage_key = mock.Mock()\n # now that that's done, instantiate a DataDisk with the account\n self.data_disk = DataDisk(account)\n # asynchronous API operations return a request object\n self.my_request = mock.Mock(request_id=42)\n # variables used in multiple tests\n self.cloud_service_name = 'mockcloudservice'\n self.instance_name = 'mockcloudserviceinstance1'\n self.lun = 0\n self.host_caching = 'ReadWrite'\n self.disk_filename = 'mockcloudserviceinstance1-data-disk-0.vhd'\n self.disk_url = (\n 'https://' +\n account.storage_name() +\n '.blob.' +\n account.get_blob_service_host_base() + '/' +\n account.storage_container() + '/' +\n self.disk_filename\n )\n self.disk_label = 'Mock data disk'\n self.disk_size = 42\n self.timestamp = datetime.utcnow()\n self.time_string = datetime.isoformat(self.timestamp)", "metadata": "root.TestDataDisk.setup", "header": "['class', 'TestDataDisk', ':', '___EOS___']", "index": 18 }, { "content": " def create_mock_data_disk(self, lun):\n return mock.Mock(\n host_caching=self.host_caching,\n disk_label=self.disk_label,\n disk_name='',\n lun=lun,\n logical_disk_size_in_gb=self.disk_size,\n media_link=self.disk_url,\n source_media_link=''\n )", "metadata": "root.TestDataDisk.create_mock_data_disk", "header": "['class', 'TestDataDisk', ':', '___EOS___']", "index": 54 }, { "content": " def create_expected_data_disk_output(self, lun):\n return {\n 'size': '%d GB' % self.disk_size,\n 'label': self.disk_label,\n 'disk-url': self.disk_url,\n 'source-image-url': '',\n 'lun': lun,\n 'host-caching': 'ReadWrite'\n }", "metadata": "root.TestDataDisk.create_expected_data_disk_output", "header": "['class', 'TestDataDisk', ':', '___EOS___']", "index": 65 }, { "content": " def test_create(self):\n # given\n self.service.add_data_disk.return_value = self.my_request\n # when\n result = self.data_disk.create(\n self.cloud_service_name,\n self.instance_name,\n self.disk_size,\n lun=self.lun,\n host_caching=self.host_caching,\n filename=self.disk_filename,\n label=self.disk_label\n )\n # then\n assert result == self.my_request.request_id\n self.service.add_data_disk.assert_called_once_with(\n self.cloud_service_name,\n self.instance_name,\n self.cloud_service_name,\n self.lun,\n host_caching=self.host_caching,\n media_link=self.disk_url,\n disk_label=self.disk_label,\n logical_disk_size_in_gb=self.disk_size\n )", "metadata": "root.TestDataDisk.test_create", "header": "['class', 'TestDataDisk', ':', '___EOS___']", "index": 75 }, { "content": " @raises(AzureDataDiskCreateError)\n def test_create_upstream_exception(self):\n # given\n self.service.add_data_disk.side_effect = Exception\n # when\n self.data_disk.create(\n self.cloud_service_name,\n self.instance_name,\n self.disk_size,\n lun=self.lun,\n host_caching=self.host_caching,\n filename=self.disk_filename,\n label=self.disk_label\n )", "metadata": "root.TestDataDisk.test_create_upstream_exception", "header": "['class', 'TestDataDisk', ':', '___EOS___']", "index": 101 }, { "content": " def test_get_first_available_lun(self):\n # given\n self.service.get_data_disk.side_effect = iter([\n self.create_mock_data_disk(0),\n self.create_mock_data_disk(1),\n AzureMissingResourceHttpError('NOT FOUND', 404)\n ])\n # when\n result = self.data_disk._DataDisk__get_first_available_lun(\n self.cloud_service_name,\n self.instance_name\n )\n # then\n assert self.service.get_data_disk.call_count == 3\n assert result == 2 # 0 and 1 are taken", "metadata": "root.TestDataDisk.test_get_first_available_lun", "header": "['class', 'TestDataDisk', ':', '___EOS___']", "index": 116 }, { "content": " @raises(AzureDataDiskNoAvailableLun)\n def test_no_available_lun_exception(self):\n # given\n self.service.get_data_disk.side_effect = iter([\n self.create_mock_data_disk(i) for i in range(16)\n ])\n # when\n self.data_disk._DataDisk__get_first_available_lun(\n self.cloud_service_name,\n self.instance_name\n )\n # then\n assert self.service.get_data_disk.call_count == 16", "metadata": "root.TestDataDisk.test_no_available_lun_exception", "header": "['class', 'TestDataDisk', ':', '___EOS___']", "index": 132 }, { "content": " @patch('azurectl.instance.data_disk.DataDisk._DataDisk__get_first_available_lun')\n def test_create_without_lun(self, mock_lun):\n # given\n self.service.add_data_disk.return_value = self.my_request\n mock_lun.return_value = 0\n # when\n result = self.data_disk.create(\n self.cloud_service_name,\n self.instance_name,\n self.disk_size,\n # lun=self.lun,\n host_caching=self.host_caching,\n filename=self.disk_filename,\n label=self.disk_label\n )\n # then\n self.service.add_data_disk.assert_called_once_with(\n self.cloud_service_name,\n self.instance_name,\n self.cloud_service_name,\n 0,\n host_caching=self.host_caching,\n media_link=self.disk_url,\n disk_label=self.disk_label,\n logical_disk_size_in_gb=self.disk_size\n )", "metadata": "root.TestDataDisk.test_create_without_lun", "header": "['class', 'TestDataDisk', ':', '___EOS___']", "index": 146 }, { "content": " @patch('azurectl.instance.data_disk.datetime')\n def test_generate_filename(self, mock_timestamp):\n # given\n mock_timestamp.utcnow = mock.Mock(return_value=self.timestamp)\n mock_timestamp.isoformat = mock.Mock(return_value=self.time_string)\n expected = '%s-data-disk-%s.vhd' % (\n self.instance_name,\n self.time_string\n )\n # when\n result = self.data_disk._DataDisk__generate_filename(self.instance_name)\n # then\n assert result == expected", "metadata": "root.TestDataDisk.test_generate_filename", "header": "['class', 'TestDataDisk', ':', '___EOS___']", "index": 173 }, { "content": " @patch('azurectl.instance.data_disk.DataDisk._DataDisk__generate_filename')\n def test_create_without_filename(self, mock_generate_filename):\n # given\n self.service.add_data_disk.return_value = self.my_request\n mock_generate_filename.return_value = self.disk_filename\n # when\n result = self.data_disk.create(\n self.cloud_service_name,\n self.instance_name,\n self.disk_size,\n lun=self.lun,\n host_caching=self.host_caching,\n # filename=self.disk_filename,\n label=self.disk_label\n )\n # then\n self.service.add_data_disk.assert_called_once_with(\n self.cloud_service_name,\n self.instance_name,\n self.cloud_service_name,\n self.lun,\n host_caching=self.host_caching,\n media_link=self.disk_url,\n disk_label=self.disk_label,\n logical_disk_size_in_gb=self.disk_size\n )", "metadata": "root.TestDataDisk.test_create_without_filename", "header": "['class', 'TestDataDisk', ':', '___EOS___']", "index": 187 }, { "content": " def test_show(self):\n # given\n self.service.get_data_disk.return_value = self.create_mock_data_disk(\n self.lun\n )\n expected = self.create_expected_data_disk_output(self.lun)\n # when\n result = self.data_disk.show(\n self.cloud_service_name,\n self.instance_name,\n self.lun\n )\n # then\n self.service.get_data_disk.assert_called_once_with(\n self.cloud_service_name,\n self.instance_name,\n self.cloud_service_name,\n self.lun\n )\n assert result == expected", "metadata": "root.TestDataDisk.test_show", "header": "['class', 'TestDataDisk', ':', '___EOS___']", "index": 214 }, { "content": " @raises(AzureDataDiskShowError)\n def test_show_upsteam_exception(self):\n # given\n self.service.get_data_disk.side_effect = Exception\n # when\n self.data_disk.show(\n self.cloud_service_name,\n self.instance_name,\n self.lun\n )", "metadata": "root.TestDataDisk.test_show_upsteam_exception", "header": "['class', 'TestDataDisk', ':', '___EOS___']", "index": 235 }, { "content": " def test_delete(self):\n # given\n self.service.delete_data_disk.return_value = self.my_request\n # when\n result = self.data_disk.delete(\n self.cloud_service_name,\n self.instance_name,\n self.lun\n )\n # then\n self.service.delete_data_disk.assert_called_once_with(\n self.cloud_service_name,\n self.instance_name,\n self.cloud_service_name,\n self.lun,\n delete_vhd=True\n )\n assert result == self.my_request.request_id", "metadata": "root.TestDataDisk.test_delete", "header": "['class', 'TestDataDisk', ':', '___EOS___']", "index": 246 }, { "content": " @raises(AzureDataDiskDeleteError)\n def test_delete_with_upstream_exception(self):\n # given\n self.service.delete_data_disk.side_effect = Exception\n # when\n self.data_disk.delete(\n self.cloud_service_name,\n self.instance_name,\n self.lun\n )", "metadata": "root.TestDataDisk.test_delete_with_upstream_exception", "header": "['class', 'TestDataDisk', ':', '___EOS___']", "index": 265 }, { "content": " def test_list(self):\n # given\n number_of_disks = random.randint(0, 15)\n luns = random.sample(range(16), number_of_disks)\n luns.sort()\n mock_disk_set = [AzureMissingResourceHttpError('NOT FOUND', 404)] * 16\n expected_result = []\n for lun in luns:\n mock_disk_set[lun] = self.create_mock_data_disk(lun)\n expected_result.append(self.create_expected_data_disk_output(lun))\n self.service.get_data_disk.side_effect = iter(mock_disk_set)\n # when\n result = self.data_disk.list(\n self.cloud_service_name,\n self.instance_name\n )\n # then\n assert result == expected_result", "metadata": "root.TestDataDisk.test_list", "header": "['class', 'TestDataDisk', ':', '___EOS___']", "index": 276 } ]
[ { "span": "import sys", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 10 }, { "span": "from collections import namedtuple", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 34 }, { "span": "import azurectl", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 15 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "mock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "azure_", "._", "common_", "import_", "Az", "ure", "Missing", "Reso", "urc", "e", "Http", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "collections_", "import_", "namedtuple_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "datetime_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "mock_", "import_", "patch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "test\\u", "helper_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "azu", "rect", "l_", "._", "account_", "._", "service_", "import_", "Az", "ure", "Account_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "azu", "rect", "l_", "._", "azu", "rect", "l\\u", "exceptions_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "azu", "rect", "l_", "._", "config_", "._", "parser_", "import_", "Config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "azu", "rect", "l_", "._", "instance_", "._", "data\\u", "disk_", "import_", "Data", "Disk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "azu", "rect", "l_", "\\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", "Data", "Disk_", ":_", "\\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_", "[SEP]_", "class_", "Test", "Data", "Disk_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "setup_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "construct", " ", "an", " ", "account_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "account_", "=_", "Az", "ure", "Account_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Config_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "region", "\\u", "name_", "=_", "'", "Eas", "t", " ", "US", " ", "2", "'_", ",_", "filename_", "=_", "'../", "data", "/", "config", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "service_", "=_", "mock_", "._", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "account_", "._", "get", "\\u", "manage", "ment", "\\u", "service_", "=_", "mock_", "._", "Mock_", "(_", "return", "\\u", "value_", "=_", "self_", "._", "service_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "account_", "._", "get", "\\u", "blob", "\\u", "service", "\\u", "host", "\\u", "base_", "=_", "mock_", "._", "Mock_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "value_", "=_", "'", "test", ".", "url", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "account_", "._", "storage", "\\u", "key_", "=_", "mock_", "._", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "now", " ", "tha", "t", " ", "tha", "t", "'", "s", " ", "don", "e", ",", " ", "instantiate", " ", "a", " ", "Data", "Disk", " ", "with", " ", "the", " ", "account_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "data\\u", "disk_", "=_", "Data", "Disk_", "(_", "account_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "async", "hronous", " ", "API", " ", "operati", "ons", " ", "return", " ", "a", " ", "request", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "my", "\\u", "request_", "=_", "mock_", "._", "Mock_", "(_", "request", "\\u", "id_", "=_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "variab", "les", " ", "used", " ", "in", " ", "multiple", " ", "tests_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", "=_", "'", "mock", "clouds", "ervice", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", "=_", "'", "mock", "clouds", "ervice", "instance", "1", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "lun_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "host", "\\u", "caching", "_", "=_", "'", "Read", "Write", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "disk", "\\u", "filename_", "=_", "'", "mock", "clouds", "ervice", "instance", "1", "-", "data", "-", "disk", "-0", ".", "vhd", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "disk", "\\u", "url_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "https", "://'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "account_", "._", "storage", "\\u", "name_", "(_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "'.", "blob", ".'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "account_", "._", "get", "\\u", "blob", "\\u", "service", "\\u", "host", "\\u", "base_", "(_", ")_", "+_", "'/'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "account_", "._", "storage", "\\u", "container_", "(_", ")_", "+_", "'/'_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "disk", "\\u", "filename_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "disk", "\\u", "label_", "=_", "'", "Moc", "k", " ", "data", " ", "disk", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "disk", "\\u", "size_", "=_", "42_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "timestamp_", "=_", "datetime_", "._", "utcnow_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "time", "\\u", "string_", "=_", "datetime_", "._", "isoformat_", "(_", "self_", "._", "timestamp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Data", "Disk_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "mock", "\\u", "data\\u", "disk_", "(_", "self_", ",_", "lun_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "mock_", "._", "Mock_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "host", "\\u", "caching", "_", "=_", "self_", "._", "host", "\\u", "caching", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "disk", "\\u", "label_", "=_", "self_", "._", "disk", "\\u", "label_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "disk", "\\u", "name_", "=_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lun_", "=_", "lun_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logical", "\\u", "disk", "\\u", "size", "\\u", "in", "\\u", "gb_", "=_", "self_", "._", "disk", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "media", "\\u", "link_", "=_", "self_", "._", "disk", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "source", "\\u", "media", "\\u", "link_", "=_", "''_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Data", "Disk_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "create", "\\u", "expected", "\\u", "data\\u", "disk", "\\u", "output_", "(_", "self_", ",_", "lun_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "size", "'_", ":_", "'%", "d", " ", "GB", "'_", "%_", "self_", "._", "disk", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "label", "'_", ":_", "self_", "._", "disk", "\\u", "label_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disk", "-", "url", "'_", ":_", "self_", "._", "disk", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "source", "-", "image", "-", "url", "'_", ":_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "lun", "'_", ":_", "lun_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "host", "-", "caching", "'_", ":_", "'", "Read", "Write", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Data", "Disk_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "create_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "given_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "service_", "._", "add", "\\u", "data\\u", "disk_", "._", "return", "\\u", "value_", "=_", "self_", "._", "my", "\\u", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "data\\u", "disk_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "disk", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lun_", "=_", "self_", "._", "lun_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "host", "\\u", "caching", "_", "=_", "self_", "._", "host", "\\u", "caching", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filename_", "=_", "self_", "._", "disk", "\\u", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "self_", "._", "disk", "\\u", "label_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "then_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "result_", "==_", "self_", "._", "my", "\\u", "request_", "._", "request", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "service_", "._", "add", "\\u", "data\\u", "disk_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lun_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "host", "\\u", "caching", "_", "=_", "self_", "._", "host", "\\u", "caching", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "media", "\\u", "link_", "=_", "self_", "._", "disk", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "disk", "\\u", "label_", "=_", "self_", "._", "disk", "\\u", "label_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logical", "\\u", "disk", "\\u", "size", "\\u", "in", "\\u", "gb_", "=_", "self_", "._", "disk", "\\u", "size_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Data", "Disk_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "raises_", "(_", "Az", "ure", "Data", "Disk", "Creat", "e", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "create", "\\u", "ups", "tream", "\\u", "exception_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "given_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "service_", "._", "add", "\\u", "data\\u", "disk_", "._", "side", "\\u", "effect_", "=_", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "data\\u", "disk_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "disk", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lun_", "=_", "self_", "._", "lun_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "host", "\\u", "caching", "_", "=_", "self_", "._", "host", "\\u", "caching", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filename_", "=_", "self_", "._", "disk", "\\u", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "self_", "._", "disk", "\\u", "label_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Data", "Disk_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "get", "\\u", "first", "\\u", "avail", "able", "\\u", "lun_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "given_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "service_", "._", "get", "\\u", "data\\u", "disk_", "._", "side", "\\u", "effect_", "=_", "iter_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "mock", "\\u", "data\\u", "disk_", "(_", "0_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "mock", "\\u", "data\\u", "disk_", "(_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "Az", "ure", "Missing", "Reso", "urc", "e", "Http", "Error_", "(_", "'", "NOT", " ", "FO", "UND", "'_", ",_", "404_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "data\\u", "disk_", "._", "\\u", "Data", "Disk", "\\u\\u", "get", "\\u", "first", "\\u", "avail", "able", "\\u", "lun_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "then_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "self_", "._", "service_", "._", "get", "\\u", "data\\u", "disk_", "._", "call", "\\u", "count_", "==_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "==_", "2_", "#", " ", "0", " ", "and", " ", "1", " ", "are", " ", "taken_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Data", "Disk_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "raises_", "(_", "Az", "ure", "Data", "Disk", "No", "Avail", "able", "Lun", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "no", "\\u", "avail", "able", "\\u", "lun", "\\u", "exception_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "given_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "service_", "._", "get", "\\u", "data\\u", "disk_", "._", "side", "\\u", "effect_", "=_", "iter_", "(_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "create", "\\u", "mock", "\\u", "data\\u", "disk_", "(_", "i_", ")_", "for_", "i_", "in_", "range_", "(_", "16_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "data\\u", "disk_", "._", "\\u", "Data", "Disk", "\\u\\u", "get", "\\u", "first", "\\u", "avail", "able", "\\u", "lun_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "then_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "self_", "._", "service_", "._", "get", "\\u", "data\\u", "disk_", "._", "call", "\\u", "count_", "==_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Data", "Disk_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "(_", "'", "azu", "rect", "l", ".", "instance", ".", "data\\u", "disk", ".", "Data", "Disk", ".\\u", "Data", "Disk", "\\u\\u", "get", "\\u", "first", "\\u", "avail", "able", "\\u", "lun", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "create", "\\u", "with", "out", "\\u", "lun_", "(_", "self_", ",_", "mock", "\\u", "lun_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "given_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "service_", "._", "add", "\\u", "data\\u", "disk_", "._", "return", "\\u", "value_", "=_", "self_", "._", "my", "\\u", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "lun_", "._", "return", "\\u", "value_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "data\\u", "disk_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "disk", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "lun", "=", "self", ".", "lun", ",_", "\\u\\u\\uNL\\u\\u\\u_", "host", "\\u", "caching", "_", "=_", "self_", "._", "host", "\\u", "caching", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filename_", "=_", "self_", "._", "disk", "\\u", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "self_", "._", "disk", "\\u", "label_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "then_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "service_", "._", "add", "\\u", "data\\u", "disk_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "host", "\\u", "caching", "_", "=_", "self_", "._", "host", "\\u", "caching", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "media", "\\u", "link_", "=_", "self_", "._", "disk", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "disk", "\\u", "label_", "=_", "self_", "._", "disk", "\\u", "label_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logical", "\\u", "disk", "\\u", "size", "\\u", "in", "\\u", "gb_", "=_", "self_", "._", "disk", "\\u", "size_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Data", "Disk_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "(_", "'", "azu", "rect", "l", ".", "instance", ".", "data\\u", "disk", ".", "datetime", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "generat", "e\\u", "filename_", "(_", "self_", ",_", "mock", "\\u", "timestamp_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "given_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "timestamp_", "._", "utcnow_", "=_", "mock_", "._", "Mock_", "(_", "return", "\\u", "value_", "=_", "self_", "._", "timestamp_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "timestamp_", "._", "isoformat_", "=_", "mock_", "._", "Mock_", "(_", "return", "\\u", "value_", "=_", "self_", "._", "time", "\\u", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "'%", "s", "-", "data", "-", "disk", "-%", "s", ".", "vhd", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "time", "\\u", "string_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "data\\u", "disk_", "._", "\\u", "Data", "Disk", "\\u\\u", "generat", "e\\u", "filename_", "(_", "self_", "._", "instance", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "then_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "result_", "==_", "expected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Data", "Disk_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "patch_", "(_", "'", "azu", "rect", "l", ".", "instance", ".", "data\\u", "disk", ".", "Data", "Disk", ".\\u", "Data", "Disk", "\\u\\u", "generat", "e\\u", "filename", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "create", "\\u", "with", "out", "\\u", "filename_", "(_", "self_", ",_", "mock", "\\u", "generat", "e\\u", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "given_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "service_", "._", "add", "\\u", "data\\u", "disk_", "._", "return", "\\u", "value_", "=_", "self_", "._", "my", "\\u", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "generat", "e\\u", "filename_", "._", "return", "\\u", "value_", "=_", "self_", "._", "disk", "\\u", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "data\\u", "disk_", "._", "create_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "disk", "\\u", "size_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lun_", "=_", "self_", "._", "lun_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "host", "\\u", "caching", "_", "=_", "self_", "._", "host", "\\u", "caching", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "filename", "=", "self", ".", "disk", "\\u", "filename", ",_", "\\u\\u\\uNL\\u\\u\\u_", "label_", "=_", "self_", "._", "disk", "\\u", "label_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "then_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "service_", "._", "add", "\\u", "data\\u", "disk_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lun_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "host", "\\u", "caching", "_", "=_", "self_", "._", "host", "\\u", "caching", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "media", "\\u", "link_", "=_", "self_", "._", "disk", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "disk", "\\u", "label_", "=_", "self_", "._", "disk", "\\u", "label_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logical", "\\u", "disk", "\\u", "size", "\\u", "in", "\\u", "gb_", "=_", "self_", "._", "disk", "\\u", "size_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Data", "Disk_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "show_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "given_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "service_", "._", "get", "\\u", "data\\u", "disk_", "._", "return", "\\u", "value_", "=_", "self_", "._", "create", "\\u", "mock", "\\u", "data\\u", "disk_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lun_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "self_", "._", "create", "\\u", "expected", "\\u", "data\\u", "disk", "\\u", "output_", "(_", "self_", "._", "lun_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "data\\u", "disk_", "._", "show_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lun_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "then_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "service_", "._", "get", "\\u", "data\\u", "disk_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lun_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "==_", "expected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Data", "Disk_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "raises_", "(_", "Az", "ure", "Data", "Disk", "Show", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "show", "\\u", "ups", "team", "\\u", "exception_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "given_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "service_", "._", "get", "\\u", "data\\u", "disk_", "._", "side", "\\u", "effect_", "=_", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "data\\u", "disk_", "._", "show_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lun_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Data", "Disk_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "delete_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "given_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "service_", "._", "delete", "\\u", "data\\u", "disk_", "._", "return", "\\u", "value_", "=_", "self_", "._", "my", "\\u", "request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "data\\u", "disk_", "._", "delete_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lun_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "then_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "service_", "._", "delete", "\\u", "data\\u", "disk_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lun_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "delete", "\\u", "vhd", "_", "=_", "True_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "==_", "self_", "._", "my", "\\u", "request_", "._", "request", "\\u", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Data", "Disk_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "raises_", "(_", "Az", "ure", "Data", "Disk", "Delete", "Error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test\\u", "delete", "\\u", "with", "\\u", "ups", "tream", "\\u", "exception_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "given_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "service_", "._", "delete", "\\u", "data\\u", "disk_", "._", "side", "\\u", "effect_", "=_", "Exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "data\\u", "disk_", "._", "delete_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "lun_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Data", "Disk_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "list_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "given_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "number", "\\u", "of", "\\u", "disks_", "=_", "random_", "._", "randint_", "(_", "0_", ",_", "15_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lun", "s_", "=_", "random_", "._", "sample_", "(_", "range_", "(_", "16_", ")_", ",_", "number", "\\u", "of", "\\u", "disks_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lun", "s_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mock", "\\u", "disk", "\\u", "set_", "=_", "[_", "Az", "ure", "Missing", "Reso", "urc", "e", "Http", "Error_", "(_", "'", "NOT", " ", "FO", "UND", "'_", ",_", "404_", ")_", "]_", "*_", "16_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "result_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "lun_", "in_", "lun", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mock", "\\u", "disk", "\\u", "set_", "[_", "lun_", "]_", "=_", "self_", "._", "create", "\\u", "mock", "\\u", "data\\u", "disk_", "(_", "lun_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "result_", "._", "append_", "(_", "self_", "._", "create", "\\u", "expected", "\\u", "data\\u", "disk", "\\u", "output_", "(_", "lun_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "service_", "._", "get", "\\u", "data\\u", "disk_", "._", "side", "\\u", "effect_", "=_", "iter_", "(_", "mock", "\\u", "disk", "\\u", "set_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "when_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "self_", "._", "data\\u", "disk_", "._", "list_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cloud", "\\u", "service", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "instance", "\\u", "name_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "then_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "result_", "==_", "expected", "\\u", "result_" ]
[ 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, 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, 0, 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, 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,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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, 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 ]
Unused local variable
rackspace/pyrax/tests/unit/test_autoscale.py
[ { "content": " def test_mgr_replace(self):\n sg = self.scaling_group\n mgr = sg.manager\n mgr.get = Mock(return_value=sg)\n uri = \"/%s/%s/config\" % (mgr.uri_base, sg.id)\n sg.name = utils.random_unicode()\n sg.cooldown = utils.random_unicode()\n sg.min_entities = utils.random_unicode()\n sg.max_entities = utils.random_unicode()\n metadata = utils.random_unicode()\n\n new_name = utils.random_unicode()\n new_cooldown = utils.random_unicode()\n new_min = utils.random_unicode()\n new_max = utils.random_unicode()\n mgr.api.method_put = Mock(return_value=(None, None))\n expected_body = {\n \"name\": new_name,\n \"cooldown\": new_cooldown,\n \"minEntities\": new_min,\n \"maxEntities\": new_max,\n \"metadata\": {}\n }\n mgr.replace(sg.id, new_name, new_cooldown, new_min, new_max)\n mgr.api.method_put.assert_called_once_with(uri, body=expected_body)", "metadata": "root.AutoscaleTest.test_mgr_replace", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 386 }, { "content": " def test_mgr_update_launch_config(self):\n sg = self.scaling_group\n mgr = sg.manager\n mgr.get = Mock(return_value=sg)\n typ = utils.random_unicode()\n lbs = utils.random_unicode()\n name = utils.random_unicode()\n flv = utils.random_unicode()\n img = utils.random_unicode()\n dconfig = utils.random_unicode()\n metadata = utils.random_unicode()\n personality = utils.random_unicode()\n networks = utils.random_unicode()\n sg.launchConfiguration = {}\n body = {\"type\": \"launch_server\",\n \"args\": {\n \"server\": {\n \"name\": name,\n \"imageRef\": img,\n \"flavorRef\": flv,\n \"OS-DCF:diskConfig\": dconfig,\n \"personality\": mgr._encode_personality(personality),\n \"networks\": networks,\n \"metadata\": metadata,\n },\n \"loadBalancers\": lbs,\n },\n }\n mgr.api.method_put = Mock(return_value=(None, None))\n uri = \"/%s/%s/launch\" % (mgr.uri_base, sg.id)\n mgr.update_launch_config(sg.id, server_name=name, flavor=flv, image=img,\n disk_config=dconfig, metadata=metadata,\n personality=personality, networks=networks, load_balancers=lbs)\n mgr.api.method_put.assert_called_once_with(uri, body=body)", "metadata": "root.AutoscaleTest.test_mgr_update_launch_config", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 472 }, { "content": " def test_mgr_update_launch_config_unset_personality(self):\n sg = self.scaling_group\n mgr = sg.manager\n mgr.get = Mock(return_value=sg)\n typ = utils.random_unicode()\n lbs = utils.random_unicode()\n name = utils.random_unicode()\n flv = utils.random_unicode()\n img = utils.random_unicode()\n dconfig = utils.random_unicode()\n metadata = utils.random_unicode()\n personality = [{\n \"path\": \"/foo/bar\",\n \"contents\": \"cHlyYXg=\"\n }]\n networks = utils.random_unicode()\n sg.launchConfiguration = {\n \"type\": \"launch_server\",\n \"args\": {\n \"server\": {\n \"name\": name,\n \"imageRef\": img,\n \"flavorRef\": flv,\n \"OS-DCF:diskConfig\": dconfig,\n \"personality\": personality,\n \"networks\": networks,\n \"metadata\": metadata,\n },\n \"loadBalancers\": lbs,\n },\n }\n body = {\n \"type\": \"launch_server\",\n \"args\": {\n \"server\": {\n \"name\": name,\n \"imageRef\": img,\n \"flavorRef\": flv,\n \"OS-DCF:diskConfig\": dconfig,\n \"networks\": networks,\n \"metadata\": metadata,\n },\n \"loadBalancers\": lbs,\n },\n }\n mgr.api.method_put = Mock(return_value=(None, None))\n uri = \"/%s/%s/launch\" % (mgr.uri_base, sg.id)\n mgr.update_launch_config(sg.id, server_name=name, flavor=flv, image=img,\n disk_config=dconfig, metadata=metadata,\n personality=[], networks=networks, load_balancers=lbs)\n mgr.api.method_put.assert_called_once_with(uri, body=body)", "metadata": "root.AutoscaleTest.test_mgr_update_launch_config_unset_personality", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 507 }, { "content": " def test_mgr_update_launch_config_no_personality(self):\n sg = self.scaling_group\n mgr = sg.manager\n mgr.get = Mock(return_value=sg)\n typ = utils.random_unicode()\n lbs = utils.random_unicode()\n name = utils.random_unicode()\n flv = utils.random_unicode()\n img = utils.random_unicode()\n dconfig = utils.random_unicode()\n metadata = utils.random_unicode()\n networks = utils.random_unicode()\n sg.launchConfiguration = {}\n body = {\"type\": \"launch_server\",\n \"args\": {\n \"server\": {\n \"name\": name,\n \"imageRef\": img,\n \"flavorRef\": flv,\n \"OS-DCF:diskConfig\": dconfig,\n \"networks\": networks,\n \"metadata\": metadata,\n },\n \"loadBalancers\": lbs,\n },\n }\n mgr.api.method_put = Mock(return_value=(None, None))\n uri = \"/%s/%s/launch\" % (mgr.uri_base, sg.id)\n mgr.update_launch_config(sg.id, server_name=name, flavor=flv, image=img,\n disk_config=dconfig, metadata=metadata,\n networks=networks, load_balancers=lbs)\n mgr.api.method_put.assert_called_once_with(uri, body=body)", "metadata": "root.AutoscaleTest.test_mgr_update_launch_config_no_personality", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 559 }, { "content": " def test_mgr_update_launch_config_no_metadata(self):\n sg = self.scaling_group\n mgr = sg.manager\n mgr.get = Mock(return_value=sg)\n typ = utils.random_unicode()\n lbs = utils.random_unicode()\n name = utils.random_unicode()\n flv = utils.random_unicode()\n img = utils.random_unicode()\n dconfig = utils.random_unicode()\n networks = utils.random_unicode()\n sg.launchConfiguration = {}\n body = {\"type\": \"launch_server\",\n \"args\": {\n \"server\": {\n \"name\": name,\n \"imageRef\": img,\n \"flavorRef\": flv,\n \"OS-DCF:diskConfig\": dconfig,\n \"networks\": networks,\n },\n \"loadBalancers\": lbs,\n },\n }\n mgr.api.method_put = Mock(return_value=(None, None))\n uri = \"/%s/%s/launch\" % (mgr.uri_base, sg.id)\n mgr.update_launch_config(sg.id, server_name=name, flavor=flv, image=img,\n disk_config=dconfig, networks=networks, load_balancers=lbs)\n mgr.api.method_put.assert_called_once_with(uri, body=body)", "metadata": "root.AutoscaleTest.test_mgr_update_launch_config_no_metadata", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 592 }, { "content": " def test_mgr_update_launch_config_key_name(self):\n sg = self.scaling_group\n mgr = sg.manager\n mgr.get = Mock(return_value=sg)\n typ = utils.random_unicode()\n lbs = utils.random_unicode()\n name = utils.random_unicode()\n flv = utils.random_unicode()\n img = utils.random_unicode()\n dconfig = utils.random_unicode()\n metadata = utils.random_unicode()\n personality = utils.random_unicode()\n networks = utils.random_unicode()\n key_name = utils.random_unicode()\n sg.launchConfiguration = {}\n body = {\"type\": \"launch_server\",\n \"args\": {\n \"server\": {\n \"name\": name,\n \"imageRef\": img,\n \"flavorRef\": flv,\n \"OS-DCF:diskConfig\": dconfig,\n \"networks\": networks,\n \"metadata\": metadata,\n \"key_name\": key_name,\n \"personality\": mgr._encode_personality(personality),\n },\n \"loadBalancers\": lbs,\n },\n }\n mgr.api.method_put = Mock(return_value=(None, None))\n uri = \"/%s/%s/launch\" % (mgr.uri_base, sg.id)\n mgr.update_launch_config(sg.id, server_name=name, flavor=flv, image=img,\n disk_config=dconfig, metadata=metadata,\n personality=personality, networks=networks, load_balancers=lbs,\n key_name=key_name)\n mgr.api.method_put.assert_called_once_with(uri, body=body)", "metadata": "root.AutoscaleTest.test_mgr_update_launch_config_key_name", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 622 }, { "content": " def test_mgr_list_policies(self):\n sg = self.scaling_group\n mgr = sg.manager\n ret_body = {\"policies\": [{}]}\n mgr.api.method_get = Mock(return_value=(None, ret_body))\n uri = \"/%s/%s/policies\" % (mgr.uri_base, sg.id)\n ret = mgr.list_policies(sg)\n mgr.api.method_get.assert_called_once_with(uri)", "metadata": "root.AutoscaleTest.test_mgr_list_policies", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 794 }, { "content": " def test_mgr_replace_policy(self):\n sg = self.scaling_group\n mgr = sg.manager\n pol_id = utils.random_unicode()\n info = {\n \"name\": utils.random_unicode(),\n \"type\": utils.random_unicode(),\n \"cooldown\": utils.random_unicode(),\n \"change\": utils.random_unicode(),\n \"args\": utils.random_unicode(),\n }\n policy = fakes.FakeAutoScalePolicy(mgr, info, sg)\n mgr.get_policy = Mock(return_value=policy)\n\n new_name = utils.random_unicode()\n new_type = utils.random_unicode()\n new_cooldown = utils.random_unicode()\n new_change_percent = utils.random_unicode()\n\n mgr.api.method_put = Mock(return_value=(None, None))\n uri = \"/%s/%s/policies/%s\" % (mgr.uri_base, sg.id, pol_id)\n expected = {\n \"name\": new_name,\n \"type\": new_type,\n \"cooldown\": new_cooldown,\n \"changePercent\": new_change_percent,\n }\n ret = mgr.replace_policy(sg, pol_id, name=new_name,\n policy_type=new_type, cooldown=new_cooldown,\n change=new_change_percent, is_percent=True)\n mgr.api.method_put.assert_called_with(uri, body=expected)", "metadata": "root.AutoscaleTest.test_mgr_replace_policy", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 814 }, { "content": " def test_mgr_update_policy(self):\n sg = self.scaling_group\n mgr = sg.manager\n pol = utils.random_unicode()\n name = utils.random_unicode()\n ptype = utils.random_unicode()\n cooldown = utils.random_unicode()\n change = utils.random_unicode()\n args = utils.random_unicode()\n mgr.get_policy = Mock(return_value=fakes.FakeAutoScalePolicy(mgr, {},\n sg))\n mgr.api.method_put = Mock(return_value=(None, None))\n uri = \"/%s/%s/policies/%s\" % (mgr.uri_base, sg.id, pol)\n for is_percent in (True, False):\n put_body = {\"name\": name, \"cooldown\": cooldown, \"type\": ptype,\n \"args\": args}\n if is_percent:\n put_body[\"changePercent\"] = change\n else:\n put_body[\"change\"] = change\n ret = mgr.update_policy(sg, pol, name=name, policy_type=ptype,\n cooldown=cooldown, change=change, is_percent=is_percent,\n args=args)\n mgr.api.method_put.assert_called_with(uri, body=put_body)", "metadata": "root.AutoscaleTest.test_mgr_update_policy", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 846 }, { "content": " def test_mgr_update_policy_desired_to_desired(self):\n sg = self.scaling_group\n mgr = sg.manager\n pol = utils.random_unicode()\n name = utils.random_unicode()\n ptype = utils.random_unicode()\n cooldown = utils.random_unicode()\n change = utils.random_unicode()\n args = utils.random_unicode()\n new_desired_capacity = 10\n old_info = {\"desiredCapacity\": 0}\n mgr.get_policy = Mock(\n return_value=fakes.FakeAutoScalePolicy(mgr, old_info, sg))\n mgr.api.method_put = Mock(return_value=(None, None))\n uri = \"/%s/%s/policies/%s\" % (mgr.uri_base, sg.id, pol)\n put_body = {\"name\": name, \"cooldown\": cooldown, \"type\": ptype,\n \"desiredCapacity\": new_desired_capacity}\n ret = mgr.update_policy(sg, pol, name=name, policy_type=ptype,\n cooldown=cooldown, desired_capacity=new_desired_capacity)\n mgr.api.method_put.assert_called_with(uri, body=put_body)", "metadata": "root.AutoscaleTest.test_mgr_update_policy_desired_to_desired", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 871 }, { "content": " def test_mgr_update_policy_change_to_desired(self):\n sg = self.scaling_group\n mgr = sg.manager\n pol = utils.random_unicode()\n name = utils.random_unicode()\n ptype = utils.random_unicode()\n cooldown = utils.random_unicode()\n change = utils.random_unicode()\n args = utils.random_unicode()\n new_desired_capacity = 10\n old_info = {\"change\": -1}\n mgr.get_policy = Mock(\n return_value=fakes.FakeAutoScalePolicy(mgr, old_info, sg))\n mgr.api.method_put = Mock(return_value=(None, None))\n uri = \"/%s/%s/policies/%s\" % (mgr.uri_base, sg.id, pol)\n put_body = {\"name\": name, \"cooldown\": cooldown, \"type\": ptype,\n \"desiredCapacity\": new_desired_capacity}\n ret = mgr.update_policy(sg, pol, name=name, policy_type=ptype,\n cooldown=cooldown, desired_capacity=new_desired_capacity)\n mgr.api.method_put.assert_called_with(uri, body=put_body)", "metadata": "root.AutoscaleTest.test_mgr_update_policy_change_to_desired", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 892 }, { "content": " def test_mgr_update_policy_desired_to_change(self):\n sg = self.scaling_group\n mgr = sg.manager\n pol = utils.random_unicode()\n name = utils.random_unicode()\n ptype = utils.random_unicode()\n cooldown = utils.random_unicode()\n change = utils.random_unicode()\n args = utils.random_unicode()\n new_change = 1\n old_info = {\"desiredCapacity\": 0}\n mgr.get_policy = Mock(\n return_value=fakes.FakeAutoScalePolicy(mgr, old_info, sg))\n mgr.api.method_put = Mock(return_value=(None, None))\n uri = \"/%s/%s/policies/%s\" % (mgr.uri_base, sg.id, pol)\n put_body = {\"name\": name, \"cooldown\": cooldown, \"type\": ptype,\n \"change\": new_change}\n ret = mgr.update_policy(sg, pol, name=name, policy_type=ptype,\n cooldown=cooldown, change=new_change)\n mgr.api.method_put.assert_called_with(uri, body=put_body)", "metadata": "root.AutoscaleTest.test_mgr_update_policy_desired_to_change", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 913 }, { "content": " def test_mgr_update_policy_maintain_desired_capacity(self):\n sg = self.scaling_group\n mgr = sg.manager\n pol = utils.random_unicode()\n name = utils.random_unicode()\n ptype = utils.random_unicode()\n cooldown = utils.random_unicode()\n change = utils.random_unicode()\n args = utils.random_unicode()\n new_name = utils.random_unicode()\n old_capacity = 0\n old_info = {\n \"type\": ptype,\n \"desiredCapacity\": old_capacity,\n \"cooldown\": cooldown,\n }\n mgr.get_policy = Mock(\n return_value=fakes.FakeAutoScalePolicy(mgr, old_info, sg))\n mgr.api.method_put = Mock(return_value=(None, None))\n uri = \"/%s/%s/policies/%s\" % (mgr.uri_base, sg.id, pol)\n put_body = {\"name\": new_name, \"cooldown\": cooldown, \"type\": ptype,\n \"desiredCapacity\": old_capacity}\n ret = mgr.update_policy(sg, pol, name=new_name)\n mgr.api.method_put.assert_called_with(uri, body=put_body)", "metadata": "root.AutoscaleTest.test_mgr_update_policy_maintain_desired_capacity", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 934 }, { "content": " def test_mgr_update_policy_maintain_is_percent(self):\n sg = self.scaling_group\n mgr = sg.manager\n pol = utils.random_unicode()\n name = utils.random_unicode()\n ptype = utils.random_unicode()\n cooldown = utils.random_unicode()\n new_name = utils.random_unicode()\n old_percent = 10\n old_info = {\n \"type\": ptype,\n \"changePercent\": old_percent,\n \"cooldown\": cooldown,\n }\n mgr.get_policy = Mock(\n return_value=fakes.FakeAutoScalePolicy(mgr, old_info, sg))\n mgr.api.method_put = Mock(return_value=(None, None))\n uri = \"/%s/%s/policies/%s\" % (mgr.uri_base, sg.id, pol)\n put_body = {\"name\": new_name, \"cooldown\": cooldown, \"type\": ptype,\n \"changePercent\": old_percent}\n ret = mgr.update_policy(sg, pol, name=new_name)\n mgr.api.method_put.assert_called_with(uri, body=put_body)", "metadata": "root.AutoscaleTest.test_mgr_update_policy_maintain_is_percent", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 959 }, { "content": " def test_mgr_update_policy_maintain_is_absolute(self):\n sg = self.scaling_group\n mgr = sg.manager\n pol = utils.random_unicode()\n name = utils.random_unicode()\n ptype = utils.random_unicode()\n cooldown = utils.random_unicode()\n change = utils.random_unicode()\n new_name = utils.random_unicode()\n old_change = 10\n old_info = {\n \"type\": ptype,\n \"change\": old_change,\n \"cooldown\": cooldown,\n }\n mgr.get_policy = Mock(\n return_value=fakes.FakeAutoScalePolicy(mgr, old_info, sg))\n mgr.api.method_put = Mock(return_value=(None, None))\n uri = \"/%s/%s/policies/%s\" % (mgr.uri_base, sg.id, pol)\n put_body = {\"name\": new_name, \"cooldown\": cooldown, \"type\": ptype,\n \"change\": old_change}\n ret = mgr.update_policy(sg, pol, name=new_name)\n mgr.api.method_put.assert_called_with(uri, body=put_body)", "metadata": "root.AutoscaleTest.test_mgr_update_policy_maintain_is_absolute", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 982 }, { "content": " def test_mgr_list_webhooks(self):\n sg = self.scaling_group\n mgr = sg.manager\n pol = fakes.FakeAutoScalePolicy(mgr, {}, sg)\n ret_body = {\"webhooks\": [{}]}\n mgr.api.method_get = Mock(return_value=(None, ret_body))\n mgr.get_policy = Mock(return_value=fakes.FakeAutoScalePolicy(mgr, {},\n sg))\n uri = \"/%s/%s/policies/%s/webhooks\" % (mgr.uri_base, sg.id, pol.id)\n ret = mgr.list_webhooks(sg, pol)\n mgr.api.method_get.assert_called_once_with(uri)", "metadata": "root.AutoscaleTest.test_mgr_list_webhooks", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1040 }, { "content": " def test_mgr_replace_webhook(self):\n sg = self.scaling_group\n mgr = sg.manager\n pol = fakes.FakeAutoScalePolicy(mgr, {}, sg)\n hook = utils.random_unicode()\n info = {\"name\": utils.random_unicode(),\n \"metadata\": utils.random_unicode()}\n hook_obj = fakes.FakeAutoScaleWebhook(mgr, info, pol, sg)\n new_name = utils.random_unicode()\n new_metadata = utils.random_unicode()\n mgr.get_webhook = Mock(return_value=hook_obj)\n mgr.api.method_put = Mock(return_value=(None, None))\n uri = \"/%s/%s/policies/%s/webhooks/%s\" % (mgr.uri_base, sg.id, pol.id,\n hook)\n expected = {\"name\": new_name, \"metadata\": {}}\n ret = mgr.replace_webhook(sg, pol, hook, name=new_name)\n mgr.api.method_put.assert_called_with(uri, body=expected)", "metadata": "root.AutoscaleTest.test_mgr_replace_webhook", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1065 }, { "content": " def test_mgr_update_webhook(self):\n sg = self.scaling_group\n mgr = sg.manager\n pol = fakes.FakeAutoScalePolicy(mgr, {}, sg)\n hook = utils.random_unicode()\n hook_obj = fakes.FakeAutoScaleWebhook(mgr, {}, pol, sg)\n name = utils.random_unicode()\n metadata = utils.random_unicode()\n mgr.get_webhook = Mock(return_value=hook_obj)\n mgr.api.method_put = Mock(return_value=(None, None))\n uri = \"/%s/%s/policies/%s/webhooks/%s\" % (mgr.uri_base, sg.id, pol.id,\n hook)\n put_body = {\"name\": name, \"metadata\": metadata}\n ret = mgr.update_webhook(sg, pol, hook, name=name, metadata=metadata)\n mgr.api.method_put.assert_called_with(uri, body=put_body)", "metadata": "root.AutoscaleTest.test_mgr_update_webhook", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1083 }, { "content": " def test_mgr_update_webhook_metadata(self):\n sg = self.scaling_group\n mgr = sg.manager\n pol = fakes.FakeAutoScalePolicy(mgr, {}, sg)\n hook = utils.random_unicode()\n hook_obj = fakes.FakeAutoScaleWebhook(mgr, {}, pol, sg)\n hook_obj.metadata = {\"orig\": \"orig\"}\n metadata = {\"new\": \"new\"}\n expected = hook_obj.metadata.copy()\n expected.update(metadata)\n uri = \"/%s/%s/policies/%s/webhooks/%s\" % (mgr.uri_base, sg.id, pol.id,\n hook)\n mgr.update_webhook = Mock()\n mgr.get_webhook = Mock(return_value=hook_obj)\n mgr.update_webhook_metadata(sg, pol, hook, metadata)\n mgr.update_webhook.assert_called_once_with(sg, pol, hook_obj,\n metadata=expected)", "metadata": "root.AutoscaleTest.test_mgr_update_webhook_metadata", "header": "['class', 'AutoscaleTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 1099 } ]
[ { "span": "metadata ", "start_line": 395, "start_column": 8, "end_line": 395, "end_column": 16 }, { "span": "typ ", "start_line": 476, "start_column": 8, "end_line": 476, "end_column": 11 }, { "span": "typ ", "start_line": 511, "start_column": 8, "end_line": 511, "end_column": 11 }, { "span": "typ ", "start_line": 563, "start_column": 8, "end_line": 563, "end_column": 11 }, { "span": "typ ", "start_line": 596, "start_column": 8, "end_line": 596, "end_column": 11 }, { "span": "typ ", "start_line": 626, "start_column": 8, "end_line": 626, "end_column": 11 }, { "span": "ret ", "start_line": 800, "start_column": 8, "end_line": 800, "end_column": 11 }, { "span": "ret ", "start_line": 841, "start_column": 8, "end_line": 841, "end_column": 11 }, { "span": "ret ", "start_line": 866, "start_column": 12, "end_line": 866, "end_column": 15 }, { "span": "change ", "start_line": 878, "start_column": 8, "end_line": 878, "end_column": 14 }, { "span": "args ", "start_line": 879, "start_column": 8, "end_line": 879, "end_column": 12 }, { "span": "ret ", "start_line": 888, "start_column": 8, "end_line": 888, "end_column": 11 }, { "span": "change ", "start_line": 899, "start_column": 8, "end_line": 899, "end_column": 14 }, { "span": "args ", "start_line": 900, "start_column": 8, "end_line": 900, "end_column": 12 }, { "span": "ret ", "start_line": 909, "start_column": 8, "end_line": 909, "end_column": 11 }, { "span": "change ", "start_line": 920, "start_column": 8, "end_line": 920, "end_column": 14 }, { "span": "args ", "start_line": 921, "start_column": 8, "end_line": 921, "end_column": 12 }, { "span": "ret ", "start_line": 930, "start_column": 8, "end_line": 930, "end_column": 11 }, { "span": "name ", "start_line": 938, "start_column": 8, "end_line": 938, "end_column": 12 }, { "span": "change ", "start_line": 941, "start_column": 8, "end_line": 941, "end_column": 14 }, { "span": "args ", "start_line": 942, "start_column": 8, "end_line": 942, "end_column": 12 }, { "span": "ret ", "start_line": 956, "start_column": 8, "end_line": 956, "end_column": 11 }, { "span": "name ", "start_line": 963, "start_column": 8, "end_line": 963, "end_column": 12 }, { "span": "ret ", "start_line": 979, "start_column": 8, "end_line": 979, "end_column": 11 }, { "span": "name ", "start_line": 986, "start_column": 8, "end_line": 986, "end_column": 12 }, { "span": "change ", "start_line": 989, "start_column": 8, "end_line": 989, "end_column": 14 }, { "span": "ret ", "start_line": 1003, "start_column": 8, "end_line": 1003, "end_column": 11 }, { "span": "ret ", "start_line": 1049, "start_column": 8, "end_line": 1049, "end_column": 11 }, { "span": "new_metadata ", "start_line": 1074, "start_column": 8, "end_line": 1074, "end_column": 20 }, { "span": "ret ", "start_line": 1080, "start_column": 8, "end_line": 1080, "end_column": 11 }, { "span": "ret ", "start_line": 1096, "start_column": 8, "end_line": 1096, "end_column": 11 }, { "span": "uri ", "start_line": 1109, "start_column": 8, "end_line": 1109, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "replace_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "config", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sg_", "._", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sg_", "._", "cooldown", "_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sg_", "._", "min", "\\u", "entities_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sg_", "._", "max", "\\u", "entities_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "cooldown", "_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "min_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "max_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "body_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "new", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cooldown", "\"_", ":_", "new", "\\u", "cooldown", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "min", "Entit", "ies", "\"_", ":_", "new", "\\u", "min_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "max", "Entit", "ies", "\"_", ":_", "new", "\\u", "max_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "metadata", "\"_", ":_", "{_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "replace_", "(_", "sg_", "._", "id_", ",_", "new", "\\u", "name_", ",_", "new", "\\u", "cooldown", "_", ",_", "new", "\\u", "min_", ",_", "new", "\\u", "max_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "expected", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "update", "\\u", "launch", "\\u", "config_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "typ_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lb", "s_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fl", "v_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dco", "nfig_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "personality", "_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "networks_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sg_", "._", "launch", "Configuration_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "{_", "\"", "type", "\"_", ":_", "\"", "launch", "\\u", "server", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "server", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "image", "Ref", "\"_", ":_", "img_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "flavor", "Ref", "\"_", ":_", "fl", "v_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "OS", "-", "DC", "F", ":", "disk", "Config", "\"_", ":_", "dco", "nfig_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "personality", "\"_", ":_", "mgr_", "._", "\\u", "encode", "\\u", "personality", "_", "(_", "personality", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "networks_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "metadata", "\"_", ":_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "load", "Balance", "rs", "\"_", ":_", "lb", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "launch", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "update", "\\u", "launch", "\\u", "config_", "(_", "sg_", "._", "id_", ",_", "server", "\\u", "name_", "=_", "name_", ",_", "flavor_", "=_", "fl", "v_", ",_", "image_", "=_", "img_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "disk", "\\u", "config_", "=_", "dco", "nfig_", ",_", "metadata_", "=_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "personality", "_", "=_", "personality", "_", ",_", "networks_", "=_", "networks_", ",_", "load", "\\u", "balancer", "s_", "=_", "lb", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "update", "\\u", "launch", "\\u", "config", "\\u", "unse", "t", "\\u", "personality", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "typ_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lb", "s_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fl", "v_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dco", "nfig_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "personality", "_", "=_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "path", "\"_", ":_", "\"/", "foo", "/", "bar", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "content", "s", "\"_", ":_", "\"", "c", "Hl", "y", "YX", "g", "=\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "networks_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sg_", "._", "launch", "Configuration_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "launch", "\\u", "server", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "server", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "image", "Ref", "\"_", ":_", "img_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "flavor", "Ref", "\"_", ":_", "fl", "v_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "OS", "-", "DC", "F", ":", "disk", "Config", "\"_", ":_", "dco", "nfig_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "personality", "\"_", ":_", "personality", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "networks_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "metadata", "\"_", ":_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "load", "Balance", "rs", "\"_", ":_", "lb", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "launch", "\\u", "server", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "server", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "image", "Ref", "\"_", ":_", "img_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "flavor", "Ref", "\"_", ":_", "fl", "v_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "OS", "-", "DC", "F", ":", "disk", "Config", "\"_", ":_", "dco", "nfig_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "networks_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "metadata", "\"_", ":_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "load", "Balance", "rs", "\"_", ":_", "lb", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "launch", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "update", "\\u", "launch", "\\u", "config_", "(_", "sg_", "._", "id_", ",_", "server", "\\u", "name_", "=_", "name_", ",_", "flavor_", "=_", "fl", "v_", ",_", "image_", "=_", "img_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "disk", "\\u", "config_", "=_", "dco", "nfig_", ",_", "metadata_", "=_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "personality", "_", "=_", "[_", "]_", ",_", "networks_", "=_", "networks_", ",_", "load", "\\u", "balancer", "s_", "=_", "lb", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "update", "\\u", "launch", "\\u", "config", "\\u", "no", "\\u", "personality", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "typ_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lb", "s_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fl", "v_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dco", "nfig_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "networks_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sg_", "._", "launch", "Configuration_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "{_", "\"", "type", "\"_", ":_", "\"", "launch", "\\u", "server", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "server", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "image", "Ref", "\"_", ":_", "img_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "flavor", "Ref", "\"_", ":_", "fl", "v_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "OS", "-", "DC", "F", ":", "disk", "Config", "\"_", ":_", "dco", "nfig_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "networks_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "metadata", "\"_", ":_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "load", "Balance", "rs", "\"_", ":_", "lb", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "launch", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "update", "\\u", "launch", "\\u", "config_", "(_", "sg_", "._", "id_", ",_", "server", "\\u", "name_", "=_", "name_", ",_", "flavor_", "=_", "fl", "v_", ",_", "image_", "=_", "img_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "disk", "\\u", "config_", "=_", "dco", "nfig_", ",_", "metadata_", "=_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "networks_", "=_", "networks_", ",_", "load", "\\u", "balancer", "s_", "=_", "lb", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "update", "\\u", "launch", "\\u", "config", "\\u", "no", "\\u", "metadata_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "typ_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lb", "s_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fl", "v_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dco", "nfig_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "networks_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sg_", "._", "launch", "Configuration_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "{_", "\"", "type", "\"_", ":_", "\"", "launch", "\\u", "server", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "server", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "image", "Ref", "\"_", ":_", "img_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "flavor", "Ref", "\"_", ":_", "fl", "v_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "OS", "-", "DC", "F", ":", "disk", "Config", "\"_", ":_", "dco", "nfig_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "networks_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "load", "Balance", "rs", "\"_", ":_", "lb", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "launch", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "update", "\\u", "launch", "\\u", "config_", "(_", "sg_", "._", "id_", ",_", "server", "\\u", "name_", "=_", "name_", ",_", "flavor_", "=_", "fl", "v_", ",_", "image_", "=_", "img_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "disk", "\\u", "config_", "=_", "dco", "nfig_", ",_", "networks_", "=_", "networks_", ",_", "load", "\\u", "balancer", "s_", "=_", "lb", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "update", "\\u", "launch", "\\u", "config", "\\u", "key", "\\u", "name_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "typ_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lb", "s_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fl", "v_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dco", "nfig_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "personality", "_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "networks_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key", "\\u", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sg_", "._", "launch", "Configuration_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "body_", "=_", "{_", "\"", "type", "\"_", ":_", "\"", "launch", "\\u", "server", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "server", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "image", "Ref", "\"_", ":_", "img_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "flavor", "Ref", "\"_", ":_", "fl", "v_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "OS", "-", "DC", "F", ":", "disk", "Config", "\"_", ":_", "dco", "nfig_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "network", "s", "\"_", ":_", "networks_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "metadata", "\"_", ":_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "key", "\\u", "name", "\"_", ":_", "key", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "personality", "\"_", ":_", "mgr_", "._", "\\u", "encode", "\\u", "personality", "_", "(_", "personality", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "load", "Balance", "rs", "\"_", ":_", "lb", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "launch", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "update", "\\u", "launch", "\\u", "config_", "(_", "sg_", "._", "id_", ",_", "server", "\\u", "name_", "=_", "name_", ",_", "flavor_", "=_", "fl", "v_", ",_", "image_", "=_", "img_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "disk", "\\u", "config_", "=_", "dco", "nfig_", ",_", "metadata_", "=_", "metadata_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "personality", "_", "=_", "personality", "_", ",_", "networks_", "=_", "networks_", ",_", "load", "\\u", "balancer", "s_", "=_", "lb", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key", "\\u", "name_", "=_", "key", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "list", "\\u", "policies_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "\\u", "body_", "=_", "{_", "\"", "poli", "cies", "\"_", ":_", "[_", "{_", "}_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "get_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "ret", "\\u", "body_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "poli", "cies", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "mgr_", "._", "list", "\\u", "policies_", "(_", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "get_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "uri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "replace", "\\u", "policy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pol", "\\u", "id_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cooldown", "\"_", ":_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "change", "\"_", ":_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "policy_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Policy_", "(_", "mgr_", ",_", "info_", ",_", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get", "\\u", "policy_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "policy_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "type_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "cooldown", "_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "change", "\\u", "percent_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "poli", "cies", "/", "%", "s", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ",_", "pol", "\\u", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "new", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "new", "\\u", "type_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cooldown", "\"_", ":_", "new", "\\u", "cooldown", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "change", "Perce", "nt", "\"_", ":_", "new", "\\u", "change", "\\u", "percent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "mgr_", "._", "replace", "\\u", "policy_", "(_", "sg_", ",_", "pol", "\\u", "id_", ",_", "name_", "=_", "new", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "policy", "\\u", "type_", "=_", "new", "\\u", "type_", ",_", "cooldown", "_", "=_", "new", "\\u", "cooldown", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "change_", "=_", "new", "\\u", "change", "\\u", "percent_", ",_", "is", "\\u", "percent_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "update", "\\u", "policy_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pol_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ptype_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cooldown", "_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "change_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get", "\\u", "policy_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Policy_", "(_", "mgr_", ",_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "poli", "cies", "/", "%", "s", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ",_", "pol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "is", "\\u", "percent_", "in_", "(_", "True_", ",_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "put", "\\u", "body_", "=_", "{_", "\"", "name", "\"_", ":_", "name_", ",_", "\"", "cooldown", "\"_", ":_", "cooldown", "_", ",_", "\"", "type", "\"_", ":_", "ptype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "args_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "\\u", "percent_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "put", "\\u", "body_", "[_", "\"", "change", "Perce", "nt", "\"_", "]_", "=_", "change_", "\\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 ", " _", "put", "\\u", "body_", "[_", "\"", "change", "\"_", "]_", "=_", "change_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ret_", "=_", "mgr_", "._", "update", "\\u", "policy_", "(_", "sg_", ",_", "pol_", ",_", "name_", "=_", "name_", ",_", "policy", "\\u", "type_", "=_", "ptype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cooldown", "_", "=_", "cooldown", "_", ",_", "change_", "=_", "change_", ",_", "is", "\\u", "percent_", "=_", "is", "\\u", "percent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "args_", "=_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "put", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "Test_", "(_", "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", "mgr", "\\u", "update", "\\u", "policy", "\\u", "desi", "red", "\\u", "to", "\\u", "desired_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pol_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ptype_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cooldown", "_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "change_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "desi", "red", "\\u", "capacity_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "info_", "=_", "{_", "\"", "desi", "red", "Capacit", "y", "\"_", ":_", "0_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get", "\\u", "policy_", "=_", "Mock_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "value_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Policy_", "(_", "mgr_", ",_", "old", "\\u", "info_", ",_", "sg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "poli", "cies", "/", "%", "s", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ",_", "pol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "put", "\\u", "body_", "=_", "{_", "\"", "name", "\"_", ":_", "name_", ",_", "\"", "cooldown", "\"_", ":_", "cooldown", "_", ",_", "\"", "type", "\"_", ":_", "ptype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "desi", "red", "Capacit", "y", "\"_", ":_", "new", "\\u", "desi", "red", "\\u", "capacity_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "mgr_", "._", "update", "\\u", "policy_", "(_", "sg_", ",_", "pol_", ",_", "name_", "=_", "name_", ",_", "policy", "\\u", "type_", "=_", "ptype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cooldown", "_", "=_", "cooldown", "_", ",_", "desi", "red", "\\u", "capacity_", "=_", "new", "\\u", "desi", "red", "\\u", "capacity_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "put", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "update", "\\u", "policy", "\\u", "change", "\\u", "to", "\\u", "desired_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pol_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ptype_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cooldown", "_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "change_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "desi", "red", "\\u", "capacity_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "info_", "=_", "{_", "\"", "change", "\"_", ":_", "-_", "1_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get", "\\u", "policy_", "=_", "Mock_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "value_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Policy_", "(_", "mgr_", ",_", "old", "\\u", "info_", ",_", "sg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "poli", "cies", "/", "%", "s", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ",_", "pol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "put", "\\u", "body_", "=_", "{_", "\"", "name", "\"_", ":_", "name_", ",_", "\"", "cooldown", "\"_", ":_", "cooldown", "_", ",_", "\"", "type", "\"_", ":_", "ptype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "desi", "red", "Capacit", "y", "\"_", ":_", "new", "\\u", "desi", "red", "\\u", "capacity_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "mgr_", "._", "update", "\\u", "policy_", "(_", "sg_", ",_", "pol_", ",_", "name_", "=_", "name_", ",_", "policy", "\\u", "type_", "=_", "ptype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cooldown", "_", "=_", "cooldown", "_", ",_", "desi", "red", "\\u", "capacity_", "=_", "new", "\\u", "desi", "red", "\\u", "capacity_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "put", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "update", "\\u", "policy", "\\u", "desi", "red", "\\u", "to", "\\u", "change_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pol_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ptype_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cooldown", "_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "change_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "change_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "info_", "=_", "{_", "\"", "desi", "red", "Capacit", "y", "\"_", ":_", "0_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get", "\\u", "policy_", "=_", "Mock_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "value_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Policy_", "(_", "mgr_", ",_", "old", "\\u", "info_", ",_", "sg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "poli", "cies", "/", "%", "s", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ",_", "pol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "put", "\\u", "body_", "=_", "{_", "\"", "name", "\"_", ":_", "name_", ",_", "\"", "cooldown", "\"_", ":_", "cooldown", "_", ",_", "\"", "type", "\"_", ":_", "ptype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "change", "\"_", ":_", "new", "\\u", "change_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "mgr_", "._", "update", "\\u", "policy_", "(_", "sg_", ",_", "pol_", ",_", "name_", "=_", "name_", ",_", "policy", "\\u", "type_", "=_", "ptype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cooldown", "_", "=_", "cooldown", "_", ",_", "change_", "=_", "new", "\\u", "change_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "put", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "update", "\\u", "policy", "\\u", "maintain", "\\u", "desi", "red", "\\u", "capacity_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pol_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ptype_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cooldown", "_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "change_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "capacity_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "info_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "ptype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "desi", "red", "Capacit", "y", "\"_", ":_", "old", "\\u", "capacity_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cooldown", "\"_", ":_", "cooldown", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get", "\\u", "policy_", "=_", "Mock_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "value_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Policy_", "(_", "mgr_", ",_", "old", "\\u", "info_", ",_", "sg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "poli", "cies", "/", "%", "s", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ",_", "pol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "put", "\\u", "body_", "=_", "{_", "\"", "name", "\"_", ":_", "new", "\\u", "name_", ",_", "\"", "cooldown", "\"_", ":_", "cooldown", "_", ",_", "\"", "type", "\"_", ":_", "ptype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "desi", "red", "Capacit", "y", "\"_", ":_", "old", "\\u", "capacity_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "mgr_", "._", "update", "\\u", "policy_", "(_", "sg_", ",_", "pol_", ",_", "name_", "=_", "new", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "put", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "update", "\\u", "policy", "\\u", "maintain", "\\u", "is", "\\u", "percent_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pol_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ptype_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cooldown", "_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "percent_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "info_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "ptype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "change", "Perce", "nt", "\"_", ":_", "old", "\\u", "percent_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cooldown", "\"_", ":_", "cooldown", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get", "\\u", "policy_", "=_", "Mock_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "value_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Policy_", "(_", "mgr_", ",_", "old", "\\u", "info_", ",_", "sg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "poli", "cies", "/", "%", "s", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ",_", "pol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "put", "\\u", "body_", "=_", "{_", "\"", "name", "\"_", ":_", "new", "\\u", "name_", ",_", "\"", "cooldown", "\"_", ":_", "cooldown", "_", ",_", "\"", "type", "\"_", ":_", "ptype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "change", "Perce", "nt", "\"_", ":_", "old", "\\u", "percent_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "mgr_", "._", "update", "\\u", "policy_", "(_", "sg_", ",_", "pol_", ",_", "name_", "=_", "new", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "put", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "update", "\\u", "policy", "\\u", "maintain", "\\u", "is", "\\u", "absolute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pol_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ptype_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cooldown", "_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "change_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "change_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "info_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "ptype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "change", "\"_", ":_", "old", "\\u", "change_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "cooldown", "\"_", ":_", "cooldown", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get", "\\u", "policy_", "=_", "Mock_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "return", "\\u", "value_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Policy_", "(_", "mgr_", ",_", "old", "\\u", "info_", ",_", "sg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "poli", "cies", "/", "%", "s", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ",_", "pol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "put", "\\u", "body_", "=_", "{_", "\"", "name", "\"_", ":_", "new", "\\u", "name_", ",_", "\"", "cooldown", "\"_", ":_", "cooldown", "_", ",_", "\"", "type", "\"_", ":_", "ptype_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "change", "\"_", ":_", "old", "\\u", "change_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "mgr_", "._", "update", "\\u", "policy_", "(_", "sg_", ",_", "pol_", ",_", "name_", "=_", "new", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "put", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "list", "\\u", "webho", "oks", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pol_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Policy_", "(_", "mgr_", ",_", "{_", "}_", ",_", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret", "\\u", "body_", "=_", "{_", "\"", "webho", "oks", "\"_", ":_", "[_", "{_", "}_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "get_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "ret", "\\u", "body_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get", "\\u", "policy_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Policy_", "(_", "mgr_", ",_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sg_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "poli", "cies", "/", "%", "s", "/", "webho", "oks", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ",_", "pol_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "mgr_", "._", "list", "\\u", "webho", "oks", "_", "(_", "sg_", ",_", "pol_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "get_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "uri_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "replace", "\\u", "webhook_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pol_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Policy_", "(_", "mgr_", ",_", "{_", "}_", ",_", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hook_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "{_", "\"", "name", "\"_", ":_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "metadata", "\"_", ":_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hook", "\\u", "obj_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Web", "hook_", "(_", "mgr_", ",_", "info_", ",_", "pol_", ",_", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "metadata_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get", "\\u", "webhook_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "hook", "\\u", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "poli", "cies", "/", "%", "s", "/", "webho", "oks", "/", "%", "s", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ",_", "pol_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "hook_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "{_", "\"", "name", "\"_", ":_", "new", "\\u", "name_", ",_", "\"", "metadata", "\"_", ":_", "{_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "mgr_", "._", "replace", "\\u", "webhook_", "(_", "sg_", ",_", "pol_", ",_", "hook_", ",_", "name_", "=_", "new", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "update", "\\u", "webhook_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pol_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Policy_", "(_", "mgr_", ",_", "{_", "}_", ",_", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hook_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hook", "\\u", "obj_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Web", "hook_", "(_", "mgr_", ",_", "{_", "}_", ",_", "pol_", ",_", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get", "\\u", "webhook_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "hook", "\\u", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "(_", "None_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "poli", "cies", "/", "%", "s", "/", "webho", "oks", "/", "%", "s", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ",_", "pol_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "hook_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "put", "\\u", "body_", "=_", "{_", "\"", "name", "\"_", ":_", "name_", ",_", "\"", "metadata", "\"_", ":_", "metadata_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "mgr_", "._", "update", "\\u", "webhook_", "(_", "sg_", ",_", "pol_", ",_", "hook_", ",_", "name_", "=_", "name_", ",_", "metadata_", "=_", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "api_", "._", "method", "\\u", "put_", "._", "assert", "\\u", "call", "ed", "\\u", "with_", "(_", "uri_", ",_", "body_", "=_", "put", "\\u", "body_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Autos", "cale", "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", "mgr", "\\u", "update", "\\u", "webho", "ok", "\\u", "metadata_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sg_", "=_", "self_", "._", "scal", "ing", "\\u", "group_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "=_", "sg_", "._", "manager_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pol_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Policy_", "(_", "mgr_", ",_", "{_", "}_", ",_", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hook_", "=_", "utils_", "._", "random", "\\u", "unicode_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hook", "\\u", "obj_", "=_", "fakes_", "._", "Fake", "Auto", "Scale", "Web", "hook_", "(_", "mgr_", ",_", "{_", "}_", ",_", "pol_", ",_", "sg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hook", "\\u", "obj_", "._", "metadata_", "=_", "{_", "\"", "orig", "\"_", ":_", "\"", "orig", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "metadata_", "=_", "{_", "\"", "new", "\"_", ":_", "\"", "new", "\"_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "=_", "hook", "\\u", "obj_", "._", "metadata_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected_", "._", "update_", "(_", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uri_", "=_", "\"/%", "s", "/", "%", "s", "/", "poli", "cies", "/", "%", "s", "/", "webho", "oks", "/", "%", "s", "\"_", "%_", "(_", "mgr_", "._", "uri", "\\u", "base_", ",_", "sg_", "._", "id_", ",_", "pol_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "hook_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "update", "\\u", "webhook_", "=_", "Mock_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "get", "\\u", "webhook_", "=_", "Mock_", "(_", "return", "\\u", "value_", "=_", "hook", "\\u", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "update", "\\u", "webho", "ok", "\\u", "metadata_", "(_", "sg_", ",_", "pol_", ",_", "hook_", ",_", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mgr_", "._", "update", "\\u", "webhook_", "._", "assert", "\\u", "call", "ed", "\\u", "onc", "e\\u", "with_", "(_", "sg_", ",_", "pol_", ",_", "hook", "\\u", "obj_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "metadata_", "=_", "expected_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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,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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, 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 ]
Unused import
osrg/ryu/ryu/tests/unit/ofproto/test_parser_v13.py
[ { "content": "# Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.\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# vim: tabstop=4 shiftwidth=4 softtabstop=4\n\nimport unittest\nimport logging\nimport six\nimport socket\nfrom struct import *\nfrom nose.tools import *\nfrom ryu.ofproto.ofproto_v1_3_parser import *\nfrom ryu.ofproto import ofproto_v1_3_parser\nfrom ryu.ofproto import ofproto_v1_3\nfrom ryu.ofproto import ofproto_protocol\nfrom ryu.ofproto import ether\nfrom ryu.ofproto.ofproto_parser import MsgBase\nfrom ryu import utils\nfrom ryu.lib import addrconv\n\nLOG = logging.getLogger('test_ofproto_v13')\n\n\n_Datapath = ofproto_protocol.ProtocolDesc(version=ofproto_v1_3.OFP_VERSION)\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestOFPMatch(unittest.TestCase):\n\n \"\"\" Test case for ofproto_v1_3_parser.OFPMatch\n \"\"\"\n\n\n\n # set_vlan_vid\n\n\n\n\n\n\n\n", "metadata": "root.TestOFPMatch", "header": "['module', '___EOS___']", "index": 38 }, { "content": " def test_init(self):\n res = OFPMatch()\n\n # wc check\n eq_(res._wc.vlan_vid_mask, 0)\n\n # flow check\n eq_(res._flow.vlan_vid, 0)", "metadata": "root.TestOFPMatch.test_init", "header": "['class', 'TestOFPMatch', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 43 }, { "content": " def _test_serialize_and_parser(self, match, header, value, mask=None):\n cls_ = OFPMatchField._FIELDS_HEADERS.get(header)\n pack_str = cls_.pack_str.replace('!', '')\n fmt = '!HHI' + pack_str\n\n # serialize\n buf = bytearray()\n length = match.serialize(buf, 0)\n eq_(length, len(buf))\n if mask and len(buf) > calcsize(fmt):\n fmt += pack_str\n\n res = list(unpack_from(fmt, six.binary_type(buf), 0)[3:])\n if type(value) is list:\n res_value = res[:calcsize(pack_str) // 2]\n eq_(res_value, value)\n if mask:\n res_mask = res[calcsize(pack_str) // 2:]\n eq_(res_mask, mask)\n else:\n res_value = res.pop(0)\n if cls_.__name__ == 'MTVlanVid':\n eq_(res_value, value | ofproto.OFPVID_PRESENT)\n else:\n eq_(res_value, value)\n if mask and res and res[0]:\n res_mask = res[0]\n eq_(res_mask, mask)\n\n # parser\n res = match.parser(six.binary_type(buf), 0)\n eq_(res.type, ofproto.OFPMT_OXM)\n eq_(res.fields[0].header, header)\n eq_(res.fields[0].value, value)\n if mask and res.fields[0].mask is not None:\n eq_(res.fields[0].mask, mask)\n\n # to_jsondict\n jsondict = match.to_jsondict()\n\n # from_jsondict\n match2 = match.from_jsondict(jsondict[\"OFPMatch\"])\n buf2 = bytearray()\n match2.serialize(buf2, 0)\n eq_(str(match), str(match2))\n eq_(buf, buf2)", "metadata": "root.TestOFPMatch._test_serialize_and_parser", "header": "['class', 'TestOFPMatch', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 52 }, { "content": " def _test_set_vlan_vid(self, vid, mask=None):\n header = ofproto.OXM_OF_VLAN_VID\n match = OFPMatch()\n if mask is None:\n match.set_vlan_vid(vid)\n else:\n header = ofproto.OXM_OF_VLAN_VID_W\n match.set_vlan_vid_masked(vid, mask)\n self._test_serialize_and_parser(match, header, vid, mask)", "metadata": "root.TestOFPMatch._test_set_vlan_vid", "header": "['class', 'TestOFPMatch', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 100 }, { "content": " def _test_set_vlan_vid_none(self):\n header = ofproto.OXM_OF_VLAN_VID\n match = OFPMatch()\n match.set_vlan_vid_none()\n value = ofproto.OFPVID_NONE\n cls_ = OFPMatchField._FIELDS_HEADERS.get(header)\n pack_str = cls_.pack_str.replace('!', '')\n fmt = '!HHI' + pack_str\n\n # serialize\n buf = bytearray()\n length = match.serialize(buf, 0)\n eq_(length, len(buf))\n\n res = list(unpack_from(fmt, six.binary_type(buf), 0)[3:])\n res_value = res.pop(0)\n eq_(res_value, value)\n\n # parser\n res = match.parser(six.binary_type(buf), 0)\n eq_(res.type, ofproto.OFPMT_OXM)\n eq_(res.fields[0].header, header)\n eq_(res.fields[0].value, value)\n\n # to_jsondict\n jsondict = match.to_jsondict()\n\n # from_jsondict\n match2 = match.from_jsondict(jsondict[\"OFPMatch\"])\n buf2 = bytearray()\n match2.serialize(buf2, 0)\n eq_(str(match), str(match2))\n eq_(buf, buf2)", "metadata": "root.TestOFPMatch._test_set_vlan_vid_none", "header": "['class', 'TestOFPMatch', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 110 }, { "content": " def test_set_vlan_vid_mid(self):\n self._test_set_vlan_vid(2047)", "metadata": "root.TestOFPMatch.test_set_vlan_vid_mid", "header": "['class', 'TestOFPMatch', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 144 }, { "content": " def test_set_vlan_vid_max(self):\n self._test_set_vlan_vid(0xfff)", "metadata": "root.TestOFPMatch.test_set_vlan_vid_max", "header": "['class', 'TestOFPMatch', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 147 }, { "content": " def test_set_vlan_vid_min(self):\n self._test_set_vlan_vid(0)", "metadata": "root.TestOFPMatch.test_set_vlan_vid_min", "header": "['class', 'TestOFPMatch', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 150 }, { "content": " def test_set_vlan_vid_masked_mid(self):\n self._test_set_vlan_vid(2047, 0xf0f)", "metadata": "root.TestOFPMatch.test_set_vlan_vid_masked_mid", "header": "['class', 'TestOFPMatch', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 153 }, { "content": " def test_set_vlan_vid_masked_max(self):\n self._test_set_vlan_vid(2047, 0xfff)", "metadata": "root.TestOFPMatch.test_set_vlan_vid_masked_max", "header": "['class', 'TestOFPMatch', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 156 }, { "content": " def test_set_vlan_vid_masked_min(self):\n self._test_set_vlan_vid(2047, 0)", "metadata": "root.TestOFPMatch.test_set_vlan_vid_masked_min", "header": "['class', 'TestOFPMatch', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 159 }, { "content": " def test_set_vlan_vid_none(self):\n self._test_set_vlan_vid_none()", "metadata": "root.TestOFPMatch.test_set_vlan_vid_none", "header": "['class', 'TestOFPMatch', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 162 } ]
[ { "span": "import socket", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 13 }, { "span": "from ryu.ofproto import ofproto_v1_3_parser", "start_line": 24, "start_column": 0, "end_line": 24, "end_column": 43 }, { "span": "from ryu.ofproto import ether", "start_line": 27, "start_column": 0, "end_line": 27, "end_column": 29 }, { "span": "from ryu.ofproto.ofproto_parser import MsgBase", "start_line": 28, "start_column": 0, "end_line": 28, "end_column": 46 }, { "span": "from ryu import utils", "start_line": 29, "start_column": 0, "end_line": 29, "end_column": 21 }, { "span": "from ryu.lib import addrconv", "start_line": 30, "start_column": 0, "end_line": 30, "end_column": 28 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2014", " ", "Ni", "ppo", "n", " ", "Tele", "graph", " ", "and", " ", "Telephone", " ", "Cor", "porat", "ion", "._", "\\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_", "#", " ", "vim", ":", " ", "tabs", "top", "=", "4", " ", "shift", "widt", "h", "=", "4", " ", "soft", "tabs", "top", "=", "4_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "six_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "struct_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "nose_", "._", "tools_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ryu", "_", "._", "ofproto_", "._", "ofproto", "\\u", "v1", "\\u", "3", "\\u", "parser_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ryu", "_", "._", "ofproto_", "import_", "ofproto", "\\u", "v1", "\\u", "3", "\\u", "parser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ryu", "_", "._", "ofproto_", "import_", "ofproto", "\\u", "v1", "\\u", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ryu", "_", "._", "ofproto_", "import_", "ofproto", "\\u", "protocol_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ryu", "_", "._", "ofproto_", "import_", "ether", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ryu", "_", "._", "ofproto_", "._", "ofproto", "\\u", "parser_", "import_", "Msg", "Base_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ryu", "_", "import_", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ryu", "_", "._", "lib_", "import_", "addr", "conv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "LOG_", "=_", "logging_", "._", "get", "Logger_", "(_", "'", "test\\u", "ofproto", "\\u", "v1", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "Data", "path_", "=_", "ofproto", "\\u", "protocol_", "._", "Proto", "col", "Desc_", "(_", "version_", "=_", "ofproto", "\\u", "v1", "\\u", "3_", "._", "OFP", "\\u", "VERSION_", ")_", "\\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", "OFP", "Match_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Test", " ", "case", " ", "for", " ", "ofproto", "\\u", "v1", "\\u", "3", "\\u", "parser", ".", "OFP", "Match", "\\", "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_", "#", " ", "set\\u", "vlan", "\\u", "vid_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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", "OFP", "Match_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "init_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "OFP", "Match_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "wc", " ", "check_", "\\u\\u\\uNL\\u\\u\\u_", "eq\\u_", "(_", "res_", "._", "\\u", "wc_", "._", "vlan", "\\u", "vid", "\\u", "mask_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "flow", " ", "check_", "\\u\\u\\uNL\\u\\u\\u_", "eq\\u_", "(_", "res_", "._", "\\u", "flow_", "._", "vlan", "\\u", "vid_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "OFP", "Match_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "test\\u", "serialize", "\\u", "and", "\\u", "parser_", "(_", "self_", ",_", "match_", ",_", "header_", ",_", "value_", ",_", "mask_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls", "\\u_", "=_", "OFP", "Match", "Field_", "._", "\\u", "FIELDS", "\\u", "HEADERS_", "._", "get_", "(_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pack", "\\u", "str_", "=_", "cls", "\\u_", "._", "pack", "\\u", "str_", "._", "replace_", "(_", "'!'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fmt_", "=_", "'!", "HH", "I", "'_", "+_", "pack", "\\u", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "serialize_", "\\u\\u\\uNL\\u\\u\\u_", "buf_", "=_", "bytearray_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "match_", "._", "serialize_", "(_", "buf_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "length_", ",_", "len_", "(_", "buf_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mask_", "and_", "len_", "(_", "buf_", ")_", ">_", "calcsize_", "(_", "fmt_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fmt_", "+=_", "pack", "\\u", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "list_", "(_", "unpack", "\\u", "from_", "(_", "fmt_", ",_", "six_", "._", "binar", "y", "\\u", "type_", "(_", "buf_", ")_", ",_", "0_", ")_", "[_", "3_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "value_", ")_", "is_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res", "\\u", "value_", "=_", "res_", "[_", ":_", "calcsize_", "(_", "pack", "\\u", "str_", ")_", "//_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "res", "\\u", "value_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mask_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res", "\\u", "mask_", "=_", "res_", "[_", "calcsize_", "(_", "pack", "\\u", "str_", ")_", "//_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "res", "\\u", "mask_", ",_", "mask_", ")_", "\\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 ", " _", "res", "\\u", "value_", "=_", "res_", "._", "pop_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cls", "\\u_", "._", "\\u\\u", "name\\u\\u_", "==_", "'", "MT", "Vla", "n", "Vid", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq\\u_", "(_", "res", "\\u", "value_", ",_", "value_", "|_", "ofproto_", "._", "OFP", "VID", "\\u", "PRESENT", "_", ")_", "\\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 ", " _", "eq\\u_", "(_", "res", "\\u", "value_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mask_", "and_", "res_", "and_", "res_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res", "\\u", "mask_", "=_", "res_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "res", "\\u", "mask_", ",_", "mask_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parser_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "res_", "=_", "match_", "._", "parser_", "(_", "six_", "._", "binar", "y", "\\u", "type_", "(_", "buf_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "res_", "._", "type_", ",_", "ofproto_", "._", "OFP", "MT", "\\u", "OX", "M_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "res_", "._", "fields_", "[_", "0_", "]_", "._", "header_", ",_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "res_", "._", "fields_", "[_", "0_", "]_", "._", "value_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mask_", "and_", "res_", "._", "fields_", "[_", "0_", "]_", "._", "mask_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eq\\u_", "(_", "res_", "._", "fields_", "[_", "0_", "]_", "._", "mask_", ",_", "mask_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", "\\u", "json", "dict_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "json", "dict_", "=_", "match_", "._", "to", "\\u", "json", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", "\\u", "json", "dict_", "\\u\\u\\uNL\\u\\u\\u_", "match", "2_", "=_", "match_", "._", "from", "\\u", "json", "dict_", "(_", "json", "dict_", "[_", "\"", "OFP", "Match", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buf", "2_", "=_", "bytearray_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match", "2_", "._", "serialize_", "(_", "buf", "2_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "str_", "(_", "match_", ")_", ",_", "str_", "(_", "match", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "buf_", ",_", "buf", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "OFP", "Match_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "test\\u", "set\\u", "vlan", "\\u", "vid_", "(_", "self_", ",_", "vid_", ",_", "mask_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "=_", "ofproto_", "._", "OX", "M", "\\u", "OF", "\\u", "VLAN", "\\u", "VID", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "=_", "OFP", "Match_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "mask_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match_", "._", "set\\u", "vlan", "\\u", "vid_", "(_", "vid_", ")_", "\\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_", "=_", "ofproto_", "._", "OX", "M", "\\u", "OF", "\\u", "VLAN", "\\u", "VID", "\\u", "W_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "._", "set\\u", "vlan", "\\u", "vid", "\\u", "masked_", "(_", "vid_", ",_", "mask_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "test\\u", "serialize", "\\u", "and", "\\u", "parser_", "(_", "match_", ",_", "header_", ",_", "vid_", ",_", "mask_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "OFP", "Match_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "test\\u", "set\\u", "vlan", "\\u", "vid", "\\u", "none_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "=_", "ofproto_", "._", "OX", "M", "\\u", "OF", "\\u", "VLAN", "\\u", "VID", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "=_", "OFP", "Match_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match_", "._", "set\\u", "vlan", "\\u", "vid", "\\u", "none_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "ofproto_", "._", "OFP", "VID", "\\u", "NONE_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls", "\\u_", "=_", "OFP", "Match", "Field_", "._", "\\u", "FIELDS", "\\u", "HEADERS_", "._", "get_", "(_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pack", "\\u", "str_", "=_", "cls", "\\u_", "._", "pack", "\\u", "str_", "._", "replace_", "(_", "'!'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fmt_", "=_", "'!", "HH", "I", "'_", "+_", "pack", "\\u", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "serialize_", "\\u\\u\\uNL\\u\\u\\u_", "buf_", "=_", "bytearray_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "match_", "._", "serialize_", "(_", "buf_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "length_", ",_", "len_", "(_", "buf_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "list_", "(_", "unpack", "\\u", "from_", "(_", "fmt_", ",_", "six_", "._", "binar", "y", "\\u", "type_", "(_", "buf_", ")_", ",_", "0_", ")_", "[_", "3_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res", "\\u", "value_", "=_", "res_", "._", "pop_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "res", "\\u", "value_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parser_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "match_", "._", "parser_", "(_", "six_", "._", "binar", "y", "\\u", "type_", "(_", "buf_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "res_", "._", "type_", ",_", "ofproto_", "._", "OFP", "MT", "\\u", "OX", "M_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "res_", "._", "fields_", "[_", "0_", "]_", "._", "header_", ",_", "header_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "res_", "._", "fields_", "[_", "0_", "]_", "._", "value_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", "\\u", "json", "dict_", "\\u\\u\\uNL\\u\\u\\u_", "json", "dict_", "=_", "match_", "._", "to", "\\u", "json", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", "\\u", "json", "dict_", "\\u\\u\\uNL\\u\\u\\u_", "match", "2_", "=_", "match_", "._", "from", "\\u", "json", "dict_", "(_", "json", "dict_", "[_", "\"", "OFP", "Match", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "buf", "2_", "=_", "bytearray_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "match", "2_", "._", "serialize_", "(_", "buf", "2_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "str_", "(_", "match_", ")_", ",_", "str_", "(_", "match", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "eq\\u_", "(_", "buf_", ",_", "buf", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "OFP", "Match_", "(_", "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", "vlan", "\\u", "vid", "\\u", "mid_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "test\\u", "set\\u", "vlan", "\\u", "vid_", "(_", "204", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "OFP", "Match_", "(_", "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", "vlan", "\\u", "vid", "\\u", "max_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "test\\u", "set\\u", "vlan", "\\u", "vid_", "(_", "0xfff", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "OFP", "Match_", "(_", "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", "vlan", "\\u", "vid", "\\u", "min_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "test\\u", "set\\u", "vlan", "\\u", "vid_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "OFP", "Match_", "(_", "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", "vlan", "\\u", "vid", "\\u", "mask", "ed", "\\u", "mid_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "test\\u", "set\\u", "vlan", "\\u", "vid_", "(_", "204", "7_", ",_", "0xf0", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "OFP", "Match_", "(_", "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", "vlan", "\\u", "vid", "\\u", "mask", "ed", "\\u", "max_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "test\\u", "set\\u", "vlan", "\\u", "vid_", "(_", "204", "7_", ",_", "0xfff", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "OFP", "Match_", "(_", "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", "vlan", "\\u", "vid", "\\u", "mask", "ed", "\\u", "min_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "test\\u", "set\\u", "vlan", "\\u", "vid_", "(_", "204", "7_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "OFP", "Match_", "(_", "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", "vlan", "\\u", "vid", "\\u", "none_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "test\\u", "set\\u", "vlan", "\\u", "vid", "\\u", "none_", "(_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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": "root.MaxLevelFilter", "header": "['module', '___EOS___']", "index": 123 }, { "content": " def __init__(self, level):\n self.level = level", "metadata": "root.MaxLevelFilter.__init__", "header": "['class', 'MaxLevelFilter', '(', 'logging', '.', 'Filter', ')', ':', '___EOS___']", "index": 125 } ]
[ { "span": "class MaxLevelFilter(logging.Filter):", "start_line": 123, "start_column": 0, "end_line": 123, "end_column": 37 } ]
[ { "span": "def __init__(self, level):", "start_line": 125, "start_column": 4, "end_line": 125, "end_column": 30 } ]
1
false
[ "[CLS]_", "Missing", "_", "call_", "to_", " _", "`_", "\\u\\u", "init\\u\\u_", "`_", "dur", "ing_", "object_", "initialization", "_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Max", "Leve", "l", "Filter_", "(_", "logging_", "._", "Filter_", ")_", ":_", "\\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", "Leve", "l", "Filter_", "(_", "logging_", "._", "Filter_", ")_", ":_", "\\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_", ",_", "level_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "level_", "=_", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 0, 1, 1, 1, 1, 1, 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, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
mrknow/filmkodi/plugin.video.specto/resources/lib/resolvers/uptobox.py
[ { "content": "def resolve(url):\n try:\n result = client.request(url)\n\n post = {}\n f = client.parseDOM(result, 'form', attrs = {'name': 'F1'})[0]\n k = client.parseDOM(f, 'input', ret='name', attrs = {'type': 'hidden'})\n for i in k: post.update({i: client.parseDOM(f, 'input', ret='value', attrs = {'name': i})[0]})\n post = post\n\n for i in range(0, 3):\n try:\n result = client.request(url, post=post)\n\n url = client.parseDOM(result, 'div', attrs = {'align': '.+?'})\n url1 = client.parseDOM(result, 'a', ret='href')\n\n url = [i for i in url if 'button_upload' in i][0]\n url = client.parseDOM(url, 'a', ret='href')[0]\n url = ['http' + i for i in url.split('http') if 'uptobox.com' in i][0]\n return url\n except:\n time.sleep(1)\n except:\n return", "metadata": "root.resolve", "header": "['module', '___EOS___']", "index": 26 }, { "content": "def check(url):\n try:\n result = client.request(url)\n if result == None: return False\n\n result = client.parseDOM(result, 'span', attrs = {'class': 'para_title'})\n if any('File not found' in x for x in result): raise Exception()\n\n return True\n except:\n return False", "metadata": "root.check", "header": "['module', '___EOS___']", "index": 53 } ]
[ { "span": "except:", "start_line": 47, "start_column": 12, "end_line": 47, "end_column": 19 }, { "span": "except:", "start_line": 49, "start_column": 4, "end_line": 49, "end_column": 11 }, { "span": "except:", "start_line": 62, "start_column": 4, "end_line": 62, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "resolve_", "(_", "url_", ")_", ":_", "\\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 ", " _", "result_", "=_", "client_", "._", "request_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "post_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "client_", "._", "parse", "DOM_", "(_", "result_", ",_", "'", "form", "'_", ",_", "attrs_", "=_", "{_", "'", "name", "'_", ":_", "'", "F1", "'_", "}_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "k_", "=_", "client_", "._", "parse", "DOM_", "(_", "f_", ",_", "'", "input", "'_", ",_", "ret_", "=_", "'", "name", "'_", ",_", "attrs_", "=_", "{_", "'", "type", "'_", ":_", "'", "hidden", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "k_", ":_", "post_", "._", "update_", "(_", "{_", "i_", ":_", "client_", "._", "parse", "DOM_", "(_", "f_", ",_", "'", "input", "'_", ",_", "ret_", "=_", "'", "value", "'_", ",_", "attrs_", "=_", "{_", "'", "name", "'_", ":_", "i_", "}_", ")_", "[_", "0_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", "=_", "post_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "0_", ",_", "3_", ")_", ":_", "\\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 ", " _", "result_", "=_", "client_", "._", "request_", "(_", "url_", ",_", "post_", "=_", "post_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "client_", "._", "parse", "DOM_", "(_", "result_", ",_", "'", "div", "'_", ",_", "attrs_", "=_", "{_", "'", "align", "'_", ":_", "'.", "+?", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url", "1_", "=_", "client_", "._", "parse", "DOM_", "(_", "result_", ",_", "'", "a", "'_", ",_", "ret_", "=_", "'", "href", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "url_", "=_", "[_", "i_", "for_", "i_", "in_", "url_", "if_", "'", "button", "\\u", "upload", "'_", "in_", "i_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "client_", "._", "parse", "DOM_", "(_", "url_", ",_", "'", "a", "'_", ",_", "ret_", "=_", "'", "href", "'_", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url_", "=_", "[_", "'", "http", "'_", "+_", "i_", "for_", "i_", "in_", "url_", "._", "split_", "(_", "'", "http", "'_", ")_", "if_", "'", "upto", "box", ".", "com", "'_", "in_", "i_", "]_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "url_", "\\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 ", " _", "time_", "._", "sleep_", "(_", "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_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "check_", "(_", "url_", ")_", ":_", "\\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 ", " _", "result_", "=_", "client_", "._", "request_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "result_", "==_", "None_", ":_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "client_", "._", "parse", "DOM_", "(_", "result_", ",_", "'", "span", "'_", ",_", "attrs_", "=_", "{_", "'", "class", "'_", ":_", "'", "para", "\\u", "title", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "any_", "(_", "'", "File", " ", "not", " ", "found", "'_", "in_", "x_", "for_", "x_", "in_", "result_", ")_", ":_", "raise_", "Exception_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "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 ", " _", "return_", "False_" ]
[ 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Except block handles 'BaseException'
statsmodels/statsmodels/examples/python/interactions_anova.py
[ { "content": "\n## Interactions and ANOVA\n\n# Note: This script is based heavily on Jonathan Taylor's class notes http://www.stanford.edu/class/stats191/interactions.html\n#\n# Download and format data:\n\nfrom __future__ import print_function\nfrom statsmodels.compat import urlopen\nimport numpy as np\nnp.set_printoptions(precision=4, suppress=True)\nimport statsmodels.api as sm\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom statsmodels.formula.api import ols\nfrom statsmodels.graphics.api import interaction_plot, abline_plot\nfrom statsmodels.stats.anova import anova_lm\n\ntry:\n salary_table = pd.read_csv('salary.table')\nexcept: # recent pandas can read URL without urlopen\n url = 'http://stats191.stanford.edu/data/salary.table'\n fh = urlopen(url)\n salary_table = pd.read_table(fh)\n salary_table.to_csv('salary.table')\n\nE = salary_table.E\nM = salary_table.M\nX = salary_table.X\nS = salary_table.S\n\n\n# Take a look at the data:\n\nplt.figure(figsize=(6,6))\nsymbols = ['D', '^']\ncolors = ['r', 'g', 'blue']\nfactor_groups = salary_table.groupby(['E','M'])\nfor values, group in factor_groups:\n i,j = values\n plt.scatter(group['X'], group['S'], marker=symbols[j], color=colors[i-1],\n s=144)\nplt.xlabel('Experience');\nplt.ylabel('Salary');\n\n\n# Fit a linear model:\n\nformula = 'S ~ C(E) + C(M) + X'\nlm = ols(formula, salary_table).fit()\nprint(lm.summary())\n\n\n# Have a look at the created design matrix:\n\nlm.model.exog[:5]\n\n\n# Or since we initially passed in a DataFrame, we have a DataFrame available in\n\nlm.model.data.orig_exog[:5]\n\n\n# We keep a reference to the original untouched data in\n\nlm.model.data.frame[:5]\n\n\n# Influence statistics\n\ninfl = lm.get_influence()\nprint(infl.summary_table())\n\n\n# or get a dataframe\n\ndf_infl = infl.summary_frame()\n\n\ndf_infl[:5]\n\n\n# Now plot the reiduals within the groups separately:\n\nresid = lm.resid\nplt.figure(figsize=(6,6));\nfor values, group in factor_groups:\n i,j = values\n group_num = i*2 + j - 1 # for plotting purposes\n x = [group_num] * len(group)\n plt.scatter(x, resid[group.index], marker=symbols[j], color=colors[i-1],\n s=144, edgecolors='black')\nplt.xlabel('Group')\nplt.ylabel('Residuals')\n\n\n# Now we will test some interactions using anova or f_test\n\ninterX_lm = ols(\"S ~ C(E) * X + C(M)\", salary_table).fit()\nprint(interX_lm.summary())\n\n\n# Do an ANOVA check\n\nfrom statsmodels.stats.api import anova_lm\n\ntable1 = anova_lm(lm, interX_lm)\nprint(table1)\n\ninterM_lm = ols(\"S ~ X + C(E)*C(M)\", data=salary_table).fit()\nprint(interM_lm.summary())\n\ntable2 = anova_lm(lm, interM_lm)\nprint(table2)\n\n\n# The design matrix as a DataFrame\n\ninterM_lm.model.data.orig_exog[:5]\n\n\n# The design matrix as an ndarray\n\ninterM_lm.model.exog\ninterM_lm.model.exog_names\n\n\ninfl = interM_lm.get_influence()\nresid = infl.resid_studentized_internal\nplt.figure(figsize=(6,6))\nfor values, group in factor_groups:\n i,j = values\n idx = group.index\n plt.scatter(X[idx], resid[idx], marker=symbols[j], color=colors[i-1],\n s=144, edgecolors='black')\nplt.xlabel('X');\nplt.ylabel('standardized resids');\n\n\n# Looks like one observation is an outlier.\n\ndrop_idx = abs(resid).argmax()\nprint(drop_idx) # zero-based index\nidx = salary_table.index.drop(drop_idx)\n\nlm32 = ols('S ~ C(E) + X + C(M)', data=salary_table, subset=idx).fit()\n\nprint(lm32.summary())\nprint('\\n')\n\ninterX_lm32 = ols('S ~ C(E) * X + C(M)', data=salary_table, subset=idx).fit()\n\nprint(interX_lm32.summary())\nprint('\\n')\n\n\ntable3 = anova_lm(lm32, interX_lm32)\nprint(table3)\nprint('\\n')\n\n\ninterM_lm32 = ols('S ~ X + C(E) * C(M)', data=salary_table, subset=idx).fit()\n\ntable4 = anova_lm(lm32, interM_lm32)\nprint(table4)\nprint('\\n')\n\n\n# Replot the residuals\n\ntry:\n resid = interM_lm32.get_influence().summary_frame()['standard_resid']\nexcept:\n resid = interM_lm32.get_influence().summary_frame()['standard_resid']\n\nplt.figure(figsize=(6,6))\nfor values, group in factor_groups:\n i,j = values\n idx = group.index\n plt.scatter(X[idx], resid[idx], marker=symbols[j], color=colors[i-1],\n s=144, edgecolors='black')\nplt.xlabel('X[~[32]]');\nplt.ylabel('standardized resids');\n\n\n# Plot the fitted values\n\nlm_final = ols('S ~ X + C(E)*C(M)', data = salary_table.drop([drop_idx])).fit()\nmf = lm_final.model.data.orig_exog\nlstyle = ['-','--']\n\nplt.figure(figsize=(6,6))\nfor values, group in factor_groups:\n i,j = values\n idx = group.index\n plt.scatter(X[idx], S[idx], marker=symbols[j], color=colors[i-1],\n s=144, edgecolors='black')\n # drop NA because there is no idx 32 in the final model\n plt.plot(mf.X[idx].dropna(), lm_final.fittedvalues[idx].dropna(),\n ls=lstyle[j], color=colors[i-1])\nplt.xlabel('Experience');\nplt.ylabel('Salary');\n\n\n# From our first look at the data, the difference between Master's and PhD in the management group is different than in the non-management group. This is an interaction between the two qualitative variables management,M and education,E. We can visualize this by first removing the effect of experience, then plotting the means within each of the 6 groups using interaction.plot.\n\nU = S - X * interX_lm32.params['X']\n\nplt.figure(figsize=(6,6))\ninteraction_plot(E, M, U, colors=['red','blue'], markers=['^','D'],\n markersize=10, ax=plt.gca())\n\n\n# ## Minority Employment Data\n\ntry:\n jobtest_table = pd.read_table('jobtest.table')\nexcept: # don't have data already\n url = 'http://stats191.stanford.edu/data/jobtest.table'\n jobtest_table = pd.read_table(url)\n\nfactor_group = jobtest_table.groupby(['ETHN'])\n\nplt.figure(figsize=(6,6))\ncolors = ['purple', 'green']\nmarkers = ['o', 'v']\nfor factor, group in factor_group:\n plt.scatter(group['TEST'], group['JPERF'], color=colors[factor],\n marker=markers[factor], s=12**2)\nplt.xlabel('TEST');\nplt.ylabel('JPERF');\n\nmin_lm = ols('JPERF ~ TEST', data=jobtest_table).fit()\nprint(min_lm.summary())\n\nplt.figure(figsize=(6,6));\nfor factor, group in factor_group:\n plt.scatter(group['TEST'], group['JPERF'], color=colors[factor],\n marker=markers[factor], s=12**2)\n\nplt.xlabel('TEST')\nplt.ylabel('JPERF')\nabline_plot(model_results = min_lm, ax=plt.gca());\n\nmin_lm2 = ols('JPERF ~ TEST + TEST:ETHN',\n data=jobtest_table).fit()\n\nprint(min_lm2.summary())\n\nplt.figure(figsize=(6,6));\nfor factor, group in factor_group:\n plt.scatter(group['TEST'], group['JPERF'], color=colors[factor],\n marker=markers[factor], s=12**2)\n\nabline_plot(intercept = min_lm2.params['Intercept'],\n slope = min_lm2.params['TEST'], ax=plt.gca(), color='purple');\nabline_plot(intercept = min_lm2.params['Intercept'],\n slope = min_lm2.params['TEST'] + min_lm2.params['TEST:ETHN'],\n ax=plt.gca(), color='green');\n\n\nmin_lm3 = ols('JPERF ~ TEST + ETHN', data = jobtest_table).fit()\nprint(min_lm3.summary())\n\nplt.figure(figsize=(6,6));\nfor factor, group in factor_group:\n plt.scatter(group['TEST'], group['JPERF'], color=colors[factor],\n marker=markers[factor], s=12**2)\n\nabline_plot(intercept = min_lm3.params['Intercept'],\n slope = min_lm3.params['TEST'], ax=plt.gca(), color='purple');\nabline_plot(intercept = min_lm3.params['Intercept'] + min_lm3.params['ETHN'],\n slope = min_lm3.params['TEST'], ax=plt.gca(), color='green');\n\n\nmin_lm4 = ols('JPERF ~ TEST * ETHN', data = jobtest_table).fit()\nprint(min_lm4.summary())\n\nplt.figure(figsize=(6,6));\nfor factor, group in factor_group:\n plt.scatter(group['TEST'], group['JPERF'], color=colors[factor],\n marker=markers[factor], s=12**2)\n\nabline_plot(intercept = min_lm4.params['Intercept'],\n slope = min_lm4.params['TEST'], ax=plt.gca(), color='purple');\nabline_plot(intercept = min_lm4.params['Intercept'] + min_lm4.params['ETHN'],\n slope = min_lm4.params['TEST'] + min_lm4.params['TEST:ETHN'],\n ax=plt.gca(), color='green');\n\n\n# is there any effect of ETHN on slope or intercept?\ntable5 = anova_lm(min_lm, min_lm4)\nprint(table5)\n\n# is there any effect of ETHN on intercept\ntable6 = anova_lm(min_lm, min_lm3)\nprint(table6)\n\n# is there any effect of ETHN on slope\ntable7 = anova_lm(min_lm, min_lm2)\nprint(table7)\n\n# is it just the slope or both?\ntable8 = anova_lm(min_lm2, min_lm4)\nprint(table8)\n\n\n# ## One-way ANOVA\n\ntry:\n rehab_table = pd.read_csv('rehab.table')\nexcept:\n url = 'http://stats191.stanford.edu/data/rehab.csv'\n rehab_table = pd.read_table(url, delimiter=\",\")\n rehab_table.to_csv('rehab.table')\n\nplt.figure(figsize=(6,6))\nrehab_table.boxplot('Time', 'Fitness', ax=plt.gca())\n\nrehab_lm = ols('Time ~ C(Fitness)', data=rehab_table).fit()\ntable9 = anova_lm(rehab_lm)\nprint(table9)\n\nprint(rehab_lm.model.data.orig_exog)\n\nprint(rehab_lm.summary())\n\n\n# ## Two-way ANOVA\n\ntry:\n kidney_table = pd.read_table('./kidney.table')\nexcept:\n url = 'http://stats191.stanford.edu/data/kidney.table'\n kidney_table = pd.read_table(url, delimiter=\" *\")\n\n\n# Explore the dataset\n\nkidney_table.groupby(['Weight', 'Duration']).size()\n\n\n# Balanced panel\n\nkt = kidney_table\nplt.figure(figsize=(6,6))\ninteraction_plot(kt['Weight'], kt['Duration'], np.log(kt['Days']+1),\n colors=['red', 'blue'], markers=['D','^'], ms=10, ax=plt.gca())\n\n\n# You have things available in the calling namespace available in the formula evaluation namespace\n\nkidney_lm = ols('np.log(Days+1) ~ C(Duration) * C(Weight)', data=kt).fit()\n\ntable10 = anova_lm(kidney_lm)\n\nprint(anova_lm(ols('np.log(Days+1) ~ C(Duration) + C(Weight)',\n data=kt).fit(), kidney_lm))\nprint(anova_lm(ols('np.log(Days+1) ~ C(Duration)', data=kt).fit(),\n ols('np.log(Days+1) ~ C(Duration) + C(Weight, Sum)',\n data=kt).fit()))\nprint(anova_lm(ols('np.log(Days+1) ~ C(Weight)', data=kt).fit(),\n ols('np.log(Days+1) ~ C(Duration) + C(Weight, Sum)',\n data=kt).fit()))\n\n\n# ## Sum of squares\n#\n# Illustrates the use of different types of sums of squares (I,II,II)\n# and how the Sum contrast can be used to produce the same output between\n# the 3.\n#\n# Types I and II are equivalent under a balanced design.\n#\n# Don't use Type III with non-orthogonal contrast - ie., Treatment\n\nsum_lm = ols('np.log(Days+1) ~ C(Duration, Sum) * C(Weight, Sum)',\n data=kt).fit()\n\nprint(anova_lm(sum_lm))\nprint(anova_lm(sum_lm, typ=2))\nprint(anova_lm(sum_lm, typ=3))\n\nnosum_lm = ols('np.log(Days+1) ~ C(Duration, Treatment) * C(Weight, Treatment)',\n data=kt).fit()\nprint(anova_lm(nosum_lm))\nprint(anova_lm(nosum_lm, typ=2))\nprint(anova_lm(nosum_lm, typ=3))\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "except: ", "start_line": 20, "start_column": 0, "end_line": 20, "end_column": 7 }, { "span": "except:", "start_line": 172, "start_column": 0, "end_line": 172, "end_column": 7 }, { "span": "except: ", "start_line": 217, "start_column": 0, "end_line": 217, "end_column": 7 }, { "span": "except:", "start_line": 311, "start_column": 0, "end_line": 311, "end_column": 7 }, { "span": "except:", "start_line": 332, "start_column": 0, "end_line": 332, "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_", "##", " ", "Interaction", "s", " ", "and", " ", "ANO", "VA", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", ":", " ", "Thi", "s", " ", "script", " ", "is", " ", "based", " ", "heav", "il", "y", " ", "on", " ", "Jon", "ath", "an", " ", "Ta", "ylor", "'", "s", " ", "class", " ", "note", "s", " ", "http", "://", "www", ".", "stan", "for", "d", ".", "edu", "/", "class", "/", "stats", "191", "/", "interacti", "ons", ".", "html_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Down", "load", " ", "and", " ", "format", " ", "data", ":_", "\\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_", "stats", "models_", "._", "compat_", "import_", "urlopen_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "np_", "._", "set\\u", "printo", "ptions_", "(_", "precision_", "=_", "4_", ",_", "suppress_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "stats", "models_", "._", "api_", "as_", "sm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pandas_", "as_", "pd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "stats", "models_", "._", "formula_", "._", "api_", "import_", "ols_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "stats", "models_", "._", "graphics_", "._", "api_", "import_", "interacti", "on", "\\u", "plot_", ",_", "abl", "ine", "\\u", "plot_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "stats", "models_", "._", "stats_", "._", "ano", "va_", "import_", "ano", "va", "\\u", "lm_", "\\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 ", " _", "salary", "\\u", "table_", "=_", "pd_", "._", "read", "\\u", "csv_", "(_", "'", "salary", ".", "table", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "#", " ", "recent", " ", "panda", "s", " ", "can", " ", "read", " ", "URL", " ", "with", "out", " ", "urlopen_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'", "http", "://", "stats", "191", ".", "stan", "for", "d", ".", "edu", "/", "data", "/", "salary", ".", "table", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fh_", "=_", "urlopen_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "salary", "\\u", "table_", "=_", "pd_", "._", "read", "\\u", "table_", "(_", "fh_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "salary", "\\u", "table_", "._", "to", "\\u", "csv_", "(_", "'", "salary", ".", "table", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "E_", "=_", "salary", "\\u", "table_", "._", "E_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "M_", "=_", "salary", "\\u", "table_", "._", "M_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", "=_", "salary", "\\u", "table_", "._", "X_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "S_", "=_", "salary", "\\u", "table_", "._", "S_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tak", "e", " ", "a", " ", "look", " ", "at", " ", "the", " ", "data", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "6_", ",_", "6_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "symbols_", "=_", "[_", "'", "D", "'_", ",_", "'", "^", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "colors_", "=_", "[_", "'", "r", "'_", ",_", "'", "g", "'_", ",_", "'", "blue", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "factor", "\\u", "groups_", "=_", "salary", "\\u", "table_", "._", "groupby_", "(_", "[_", "'", "E", "'_", ",_", "'", "M", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "values_", ",_", "group_", "in_", "factor", "\\u", "groups_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", ",_", "j_", "=_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "scatter_", "(_", "group_", "[_", "'", "X", "'_", "]_", ",_", "group_", "[_", "'", "S", "'_", "]_", ",_", "marker_", "=_", "symbols_", "[_", "j_", "]_", ",_", "color_", "=_", "colors_", "[_", "i_", "-_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "144_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "xlabel_", "(_", "'", "Experience", "'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "'", "Sala", "ry", "'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fit", " ", "a", " ", "linear", " ", "model", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "formula_", "=_", "'", "S", " ", "~", " ", "C", "(", "E", ")", " ", "+", " ", "C", "(", "M", ")", " ", "+", " ", "X", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lm_", "=_", "ols_", "(_", "formula_", ",_", "salary", "\\u", "table_", ")_", "._", "fit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "lm_", "._", "summary_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ha", "ve", " ", "a", " ", "look", " ", "at", " ", "the", " ", "created", " ", "design", " ", "matrix", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lm_", "._", "model_", "._", "exo", "g_", "[_", ":_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Or", " ", "sinc", "e", " ", "we", " ", "initially", " ", "pass", "ed", " ", "in", " ", "a", " ", "Data", "Frame", ",", " ", "we", " ", "have", " ", "a", " ", "Data", "Frame", " ", "avail", "able", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lm_", "._", "model_", "._", "data_", "._", "orig", "\\u", "exo", "g_", "[_", ":_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "keep", " ", "a", " ", "reference", " ", "to", " ", "the", " ", "original", " ", "unto", "uche", "d", " ", "data", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lm_", "._", "model_", "._", "data_", "._", "frame_", "[_", ":_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Influ", "ence", " ", "statistics_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "infl", "_", "=_", "lm_", "._", "get", "\\u", "influence", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "infl", "_", "._", "summar", "y", "\\u", "table_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "or", " ", "get", " ", "a", " ", "dataframe_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "df", "\\u", "infl", "_", "=_", "infl", "_", "._", "summar", "y", "\\u", "frame_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "df", "\\u", "infl", "_", "[_", ":_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "plot", " ", "the", " ", "rei", "dual", "s", " ", "within", " ", "the", " ", "group", "s", " ", "separately", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "resid_", "=_", "lm_", "._", "resid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "6_", ",_", "6_", ")_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "values_", ",_", "group_", "in_", "factor", "\\u", "groups_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", ",_", "j_", "=_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group", "\\u", "num_", "=_", "i_", "*_", "2_", "+_", "j_", "-_", "1_", "#", " ", "for", " ", "plott", "ing", " ", "purpose", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "[_", "group", "\\u", "num_", "]_", "*_", "len_", "(_", "group_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "scatter_", "(_", "x_", ",_", "resid_", "[_", "group_", "._", "index_", "]_", ",_", "marker_", "=_", "symbols_", "[_", "j_", "]_", ",_", "color_", "=_", "colors_", "[_", "i_", "-_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "144_", ",_", "edge", "colors_", "=_", "'", "black", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "xlabel_", "(_", "'", "Group", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "'", "Resid", "ual", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "we", " ", "will", " ", "test", " ", "some", " ", "interacti", "ons", " ", "usi", "ng", " ", "ano", "va", " ", "or", " ", "f", "\\u", "test_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "inter", "X", "\\u", "lm_", "=_", "ols_", "(_", "\"", "S", " ", "~", " ", "C", "(", "E", ")", " ", "*", " ", "X", " ", "+", " ", "C", "(", "M", ")\"_", ",_", "salary", "\\u", "table_", ")_", "._", "fit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "inter", "X", "\\u", "lm_", "._", "summary_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", " ", "an", " ", "ANO", "VA", " ", "check_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "stats", "models_", "._", "stats_", "._", "api_", "import_", "ano", "va", "\\u", "lm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "table1_", "=_", "ano", "va", "\\u", "lm_", "(_", "lm_", ",_", "inter", "X", "\\u", "lm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "table1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "inter", "M", "\\u", "lm_", "=_", "ols_", "(_", "\"", "S", " ", "~", " ", "X", " ", "+", " ", "C", "(", "E", ")*", "C", "(", "M", ")\"_", ",_", "data_", "=_", "salary", "\\u", "table_", ")_", "._", "fit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "inter", "M", "\\u", "lm_", "._", "summary_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "table2_", "=_", "ano", "va", "\\u", "lm_", "(_", "lm_", ",_", "inter", "M", "\\u", "lm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "table2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "design", " ", "matrix", " ", "as", " ", "a", " ", "Data", "Frame_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "inter", "M", "\\u", "lm_", "._", "model_", "._", "data_", "._", "orig", "\\u", "exo", "g_", "[_", ":_", "5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "design", " ", "matrix", " ", "as", " ", "an", " ", "ndarray_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "inter", "M", "\\u", "lm_", "._", "model_", "._", "exo", "g_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inter", "M", "\\u", "lm_", "._", "model_", "._", "exo", "g", "\\u", "names_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "infl", "_", "=_", "inter", "M", "\\u", "lm_", "._", "get", "\\u", "influence", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resid_", "=_", "infl", "_", "._", "resid", "\\u", "student", "ize", "d\\u", "internal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "6_", ",_", "6_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "values_", ",_", "group_", "in_", "factor", "\\u", "groups_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", ",_", "j_", "=_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "group_", "._", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "scatter_", "(_", "X_", "[_", "idx_", "]_", ",_", "resid_", "[_", "idx_", "]_", ",_", "marker_", "=_", "symbols_", "[_", "j_", "]_", ",_", "color_", "=_", "colors_", "[_", "i_", "-_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "144_", ",_", "edge", "colors_", "=_", "'", "black", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "xlabel_", "(_", "'", "X", "'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "'", "standardize", "d", " ", "resid", "s", "'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Look", "s", " ", "like", " ", "one", " ", "observa", "tion", " ", "is", " ", "an", " ", "outlier", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "drop", "\\u", "idx_", "=_", "abs_", "(_", "resid_", ")_", "._", "argmax_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "drop", "\\u", "idx_", ")_", "#", " ", "zero", "-", "based", " ", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "salary", "\\u", "table_", "._", "index_", "._", "drop_", "(_", "drop", "\\u", "idx_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lm", "32_", "=_", "ols_", "(_", "'", "S", " ", "~", " ", "C", "(", "E", ")", " ", "+", " ", "X", " ", "+", " ", "C", "(", "M", ")'_", ",_", "data_", "=_", "salary", "\\u", "table_", ",_", "subset_", "=_", "idx_", ")_", "._", "fit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "lm", "32_", "._", "summary_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "inter", "X", "\\u", "lm", "32_", "=_", "ols_", "(_", "'", "S", " ", "~", " ", "C", "(", "E", ")", " ", "*", " ", "X", " ", "+", " ", "C", "(", "M", ")'_", ",_", "data_", "=_", "salary", "\\u", "table_", ",_", "subset_", "=_", "idx_", ")_", "._", "fit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "inter", "X", "\\u", "lm", "32_", "._", "summary_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "table", "3_", "=_", "ano", "va", "\\u", "lm_", "(_", "lm", "32_", ",_", "inter", "X", "\\u", "lm", "32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "table", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "inter", "M", "\\u", "lm", "32_", "=_", "ols_", "(_", "'", "S", " ", "~", " ", "X", " ", "+", " ", "C", "(", "E", ")", " ", "*", " ", "C", "(", "M", ")'_", ",_", "data_", "=_", "salary", "\\u", "table_", ",_", "subset_", "=_", "idx_", ")_", "._", "fit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "table", "4_", "=_", "ano", "va", "\\u", "lm_", "(_", "lm", "32_", ",_", "inter", "M", "\\u", "lm", "32_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "table", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Repl", "ot", " ", "the", " ", "residuals_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resid_", "=_", "inter", "M", "\\u", "lm", "32_", "._", "get", "\\u", "influence", "_", "(_", ")_", "._", "summar", "y", "\\u", "frame_", "(_", ")_", "[_", "'", "standard", "\\u", "resid", "'_", "]_", "\\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 ", " _", "resid_", "=_", "inter", "M", "\\u", "lm", "32_", "._", "get", "\\u", "influence", "_", "(_", ")_", "._", "summar", "y", "\\u", "frame_", "(_", ")_", "[_", "'", "standard", "\\u", "resid", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "6_", ",_", "6_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "values_", ",_", "group_", "in_", "factor", "\\u", "groups_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", ",_", "j_", "=_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "group_", "._", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "scatter_", "(_", "X_", "[_", "idx_", "]_", ",_", "resid_", "[_", "idx_", "]_", ",_", "marker_", "=_", "symbols_", "[_", "j_", "]_", ",_", "color_", "=_", "colors_", "[_", "i_", "-_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "144_", ",_", "edge", "colors_", "=_", "'", "black", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "xlabel_", "(_", "'", "X", "[~", "[", "32", "]]'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "'", "standardize", "d", " ", "resid", "s", "'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Plot", " ", "the", " ", "fitted", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lm", "\\u", "final_", "=_", "ols_", "(_", "'", "S", " ", "~", " ", "X", " ", "+", " ", "C", "(", "E", ")*", "C", "(", "M", ")'_", ",_", "data_", "=_", "salary", "\\u", "table_", "._", "drop_", "(_", "[_", "drop", "\\u", "idx_", "]_", ")_", ")_", "._", "fit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mf_", "=_", "lm", "\\u", "final_", "._", "model_", "._", "data_", "._", "orig", "\\u", "exo", "g_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lst", "yle", "_", "=_", "[_", "'-'_", ",_", "'--'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "6_", ",_", "6_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "values_", ",_", "group_", "in_", "factor", "\\u", "groups_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", ",_", "j_", "=_", "values_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "idx_", "=_", "group_", "._", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "scatter_", "(_", "X_", "[_", "idx_", "]_", ",_", "S_", "[_", "idx_", "]_", ",_", "marker_", "=_", "symbols_", "[_", "j_", "]_", ",_", "color_", "=_", "colors_", "[_", "i_", "-_", "1_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "144_", ",_", "edge", "colors_", "=_", "'", "black", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "drop", " ", "NA", " ", "bec", "aus", "e", " ", "there", " ", "is", " ", "no", " ", "idx", " ", "32", " ", "in", " ", "the", " ", "final", " ", "model_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "plot_", "(_", "mf_", "._", "X_", "[_", "idx_", "]_", "._", "dropna_", "(_", ")_", ",_", "lm", "\\u", "final_", "._", "fitted", "values_", "[_", "idx_", "]_", "._", "dropna_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ls_", "=_", "lst", "yle", "_", "[_", "j_", "]_", ",_", "color_", "=_", "colors_", "[_", "i_", "-_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "xlabel_", "(_", "'", "Experience", "'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "'", "Sala", "ry", "'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fro", "m", " ", "our", " ", "first", " ", "look", " ", "at", " ", "the", " ", "data", ",", " ", "the", " ", "difference", " ", "bet", "ween", " ", "Master", "'", "s", " ", "and", " ", "Ph", "D", " ", "in", " ", "the", " ", "manage", "ment", " ", "group", " ", "is", " ", "different", " ", "than", " ", "in", " ", "the", " ", "non", "-", "manage", "ment", " ", "group", ".", " ", "Thi", "s", " ", "is", " ", "an", " ", "interacti", "on", " ", "bet", "ween", " ", "the", " ", "two", " ", "quali", "tative", " ", "variab", "les", " ", "manage", "ment", ",", "M", " ", "and", " ", "educa", "tion", ",", "E", ".", " ", "We", " ", "can", " ", "visualize", " ", "this", " ", "by", " ", "first", " ", "remo", "ving", " ", "the", " ", "effect", " ", "of", " ", "experience", ",", " ", "then", " ", "plott", "ing", " ", "the", " ", "means", " ", "within", " ", "each", " ", "of", " ", "the", " ", "6", " ", "group", "s", " ", "usi", "ng", " ", "interacti", "on", ".", "plot", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "U_", "=_", "S_", "-_", "X_", "*_", "inter", "X", "\\u", "lm", "32_", "._", "params_", "[_", "'", "X", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "6_", ",_", "6_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "interacti", "on", "\\u", "plot_", "(_", "E_", ",_", "M_", ",_", "U_", ",_", "colors_", "=_", "[_", "'", "red", "'_", ",_", "'", "blue", "'_", "]_", ",_", "markers_", "=_", "[_", "'", "^", "'_", ",_", "'", "D", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "markersize_", "=_", "10_", ",_", "ax_", "=_", "plt_", "._", "gca_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "##", " ", "Min", "ori", "ty", " ", "Emp", "loy", "ment", " ", "Data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "job", "test\\u", "table_", "=_", "pd_", "._", "read", "\\u", "table_", "(_", "'", "job", "test", ".", "table", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "#", " ", "don", "'", "t", " ", "have", " ", "data", " ", "alr", "ead", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "'", "http", "://", "stats", "191", ".", "stan", "for", "d", ".", "edu", "/", "data", "/", "job", "test", ".", "table", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "job", "test\\u", "table_", "=_", "pd_", "._", "read", "\\u", "table_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "factor", "\\u", "group_", "=_", "job", "test\\u", "table_", "._", "groupby_", "(_", "[_", "'", "ETH", "N", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "6_", ",_", "6_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "colors_", "=_", "[_", "'", "pur", "ple", "'_", ",_", "'", "green", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "markers_", "=_", "[_", "'", "o", "'_", ",_", "'", "v", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "factor_", ",_", "group_", "in_", "factor", "\\u", "group_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plt_", "._", "scatter_", "(_", "group_", "[_", "'", "TEST", "'_", "]_", ",_", "group_", "[_", "'", "JP", "ER", "F", "'_", "]_", ",_", "color_", "=_", "colors_", "[_", "factor_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marker_", "=_", "markers_", "[_", "factor_", "]_", ",_", "s_", "=_", "12_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "xlabel_", "(_", "'", "TEST", "'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "'", "JP", "ER", "F", "'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "lm_", "=_", "ols_", "(_", "'", "JP", "ER", "F", " ", "~", " ", "TEST", "'_", ",_", "data_", "=_", "job", "test\\u", "table_", ")_", "._", "fit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "min", "\\u", "lm_", "._", "summary_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "6_", ",_", "6_", ")_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "factor_", ",_", "group_", "in_", "factor", "\\u", "group_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plt_", "._", "scatter_", "(_", "group_", "[_", "'", "TEST", "'_", "]_", ",_", "group_", "[_", "'", "JP", "ER", "F", "'_", "]_", ",_", "color_", "=_", "colors_", "[_", "factor_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marker_", "=_", "markers_", "[_", "factor_", "]_", ",_", "s_", "=_", "12_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "xlabel_", "(_", "'", "TEST", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "'", "JP", "ER", "F", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "abl", "ine", "\\u", "plot_", "(_", "model", "\\u", "results_", "=_", "min", "\\u", "lm_", ",_", "ax_", "=_", "plt_", "._", "gca_", "(_", ")_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "lm", "2_", "=_", "ols_", "(_", "'", "JP", "ER", "F", " ", "~", " ", "TEST", " ", "+", " ", "TEST", ":", "ETH", "N", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "job", "test\\u", "table_", ")_", "._", "fit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "min", "\\u", "lm", "2_", "._", "summary_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "6_", ",_", "6_", ")_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "factor_", ",_", "group_", "in_", "factor", "\\u", "group_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plt_", "._", "scatter_", "(_", "group_", "[_", "'", "TEST", "'_", "]_", ",_", "group_", "[_", "'", "JP", "ER", "F", "'_", "]_", ",_", "color_", "=_", "colors_", "[_", "factor_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marker_", "=_", "markers_", "[_", "factor_", "]_", ",_", "s_", "=_", "12_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "abl", "ine", "\\u", "plot_", "(_", "intercept_", "=_", "min", "\\u", "lm", "2_", "._", "params_", "[_", "'", "Interc", "ept", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slope_", "=_", "min", "\\u", "lm", "2_", "._", "params_", "[_", "'", "TEST", "'_", "]_", ",_", "ax_", "=_", "plt_", "._", "gca_", "(_", ")_", ",_", "color_", "=_", "'", "pur", "ple", "'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "abl", "ine", "\\u", "plot_", "(_", "intercept_", "=_", "min", "\\u", "lm", "2_", "._", "params_", "[_", "'", "Interc", "ept", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slope_", "=_", "min", "\\u", "lm", "2_", "._", "params_", "[_", "'", "TEST", "'_", "]_", "+_", "min", "\\u", "lm", "2_", "._", "params_", "[_", "'", "TEST", ":", "ETH", "N", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ax_", "=_", "plt_", "._", "gca_", "(_", ")_", ",_", "color_", "=_", "'", "green", "'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "lm", "3_", "=_", "ols_", "(_", "'", "JP", "ER", "F", " ", "~", " ", "TEST", " ", "+", " ", "ETH", "N", "'_", ",_", "data_", "=_", "job", "test\\u", "table_", ")_", "._", "fit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "min", "\\u", "lm", "3_", "._", "summary_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "6_", ",_", "6_", ")_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "factor_", ",_", "group_", "in_", "factor", "\\u", "group_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plt_", "._", "scatter_", "(_", "group_", "[_", "'", "TEST", "'_", "]_", ",_", "group_", "[_", "'", "JP", "ER", "F", "'_", "]_", ",_", "color_", "=_", "colors_", "[_", "factor_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marker_", "=_", "markers_", "[_", "factor_", "]_", ",_", "s_", "=_", "12_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "abl", "ine", "\\u", "plot_", "(_", "intercept_", "=_", "min", "\\u", "lm", "3_", "._", "params_", "[_", "'", "Interc", "ept", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slope_", "=_", "min", "\\u", "lm", "3_", "._", "params_", "[_", "'", "TEST", "'_", "]_", ",_", "ax_", "=_", "plt_", "._", "gca_", "(_", ")_", ",_", "color_", "=_", "'", "pur", "ple", "'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "abl", "ine", "\\u", "plot_", "(_", "intercept_", "=_", "min", "\\u", "lm", "3_", "._", "params_", "[_", "'", "Interc", "ept", "'_", "]_", "+_", "min", "\\u", "lm", "3_", "._", "params_", "[_", "'", "ETH", "N", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slope_", "=_", "min", "\\u", "lm", "3_", "._", "params_", "[_", "'", "TEST", "'_", "]_", ",_", "ax_", "=_", "plt_", "._", "gca_", "(_", ")_", ",_", "color_", "=_", "'", "green", "'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "min", "\\u", "lm", "4_", "=_", "ols_", "(_", "'", "JP", "ER", "F", " ", "~", " ", "TEST", " ", "*", " ", "ETH", "N", "'_", ",_", "data_", "=_", "job", "test\\u", "table_", ")_", "._", "fit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "min", "\\u", "lm", "4_", "._", "summary_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "6_", ",_", "6_", ")_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "factor_", ",_", "group_", "in_", "factor", "\\u", "group_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "plt_", "._", "scatter_", "(_", "group_", "[_", "'", "TEST", "'_", "]_", ",_", "group_", "[_", "'", "JP", "ER", "F", "'_", "]_", ",_", "color_", "=_", "colors_", "[_", "factor_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "marker_", "=_", "markers_", "[_", "factor_", "]_", ",_", "s_", "=_", "12_", "**_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "abl", "ine", "\\u", "plot_", "(_", "intercept_", "=_", "min", "\\u", "lm", "4_", "._", "params_", "[_", "'", "Interc", "ept", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slope_", "=_", "min", "\\u", "lm", "4_", "._", "params_", "[_", "'", "TEST", "'_", "]_", ",_", "ax_", "=_", "plt_", "._", "gca_", "(_", ")_", ",_", "color_", "=_", "'", "pur", "ple", "'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "abl", "ine", "\\u", "plot_", "(_", "intercept_", "=_", "min", "\\u", "lm", "4_", "._", "params_", "[_", "'", "Interc", "ept", "'_", "]_", "+_", "min", "\\u", "lm", "4_", "._", "params_", "[_", "'", "ETH", "N", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "slope_", "=_", "min", "\\u", "lm", "4_", "._", "params_", "[_", "'", "TEST", "'_", "]_", "+_", "min", "\\u", "lm", "4_", "._", "params_", "[_", "'", "TEST", ":", "ETH", "N", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ax_", "=_", "plt_", "._", "gca_", "(_", ")_", ",_", "color_", "=_", "'", "green", "'_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "there", " ", "any", " ", "effect", " ", "of", " ", "ETH", "N", " ", "on", " ", "slope", " ", "or", " ", "intercept", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "table", "5_", "=_", "ano", "va", "\\u", "lm_", "(_", "min", "\\u", "lm_", ",_", "min", "\\u", "lm", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "table", "5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "there", " ", "any", " ", "effect", " ", "of", " ", "ETH", "N", " ", "on", " ", "intercept_", "\\u\\u\\uNL\\u\\u\\u_", "table", "6_", "=_", "ano", "va", "\\u", "lm_", "(_", "min", "\\u", "lm_", ",_", "min", "\\u", "lm", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "table", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "there", " ", "any", " ", "effect", " ", "of", " ", "ETH", "N", " ", "on", " ", "slope_", "\\u\\u\\uNL\\u\\u\\u_", "table", "7_", "=_", "ano", "va", "\\u", "lm_", "(_", "min", "\\u", "lm_", ",_", "min", "\\u", "lm", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "table", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "it", " ", "just", " ", "the", " ", "slope", " ", "or", " ", "bot", "h", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "table", "8_", "=_", "ano", "va", "\\u", "lm_", "(_", "min", "\\u", "lm", "2_", ",_", "min", "\\u", "lm", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "table", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "##", " ", "One", "-", "way", " ", "ANO", "VA", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "re", "hab", "\\u", "table_", "=_", "pd_", "._", "read", "\\u", "csv_", "(_", "'", "re", "hab", ".", "table", "'_", ")_", "\\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 ", " _", "url_", "=_", "'", "http", "://", "stats", "191", ".", "stan", "for", "d", ".", "edu", "/", "data", "/", "re", "hab", ".", "csv", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "re", "hab", "\\u", "table_", "=_", "pd_", "._", "read", "\\u", "table_", "(_", "url_", ",_", "delimiter_", "=_", "\",\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "re", "hab", "\\u", "table_", "._", "to", "\\u", "csv_", "(_", "'", "re", "hab", ".", "table", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "6_", ",_", "6_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "re", "hab", "\\u", "table_", "._", "box", "plot_", "(_", "'", "Time", "'_", ",_", "'", "Fit", "ness", "'_", ",_", "ax_", "=_", "plt_", "._", "gca_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "re", "hab", "\\u", "lm_", "=_", "ols_", "(_", "'", "Time", " ", "~", " ", "C", "(", "Fit", "ness", ")'_", ",_", "data_", "=_", "re", "hab", "\\u", "table_", ")_", "._", "fit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table", "9_", "=_", "ano", "va", "\\u", "lm_", "(_", "re", "hab", "\\u", "lm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "table", "9_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "re", "hab", "\\u", "lm_", "._", "model_", "._", "data_", "._", "orig", "\\u", "exo", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "re", "hab", "\\u", "lm_", "._", "summary_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "##", " ", "Tw", "o", "-", "way", " ", "ANO", "VA", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kid", "ne", "y", "\\u", "table_", "=_", "pd_", "._", "read", "\\u", "table_", "(_", "'./", "kid", "ne", "y", ".", "table", "'_", ")_", "\\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 ", " _", "url_", "=_", "'", "http", "://", "stats", "191", ".", "stan", "for", "d", ".", "edu", "/", "data", "/", "kid", "ne", "y", ".", "table", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kid", "ne", "y", "\\u", "table_", "=_", "pd_", "._", "read", "\\u", "table_", "(_", "url_", ",_", "delimiter_", "=_", "\"", " ", "*\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Explo", "re", " ", "the", " ", "dataset_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kid", "ne", "y", "\\u", "table_", "._", "groupby_", "(_", "[_", "'", "Weig", "ht", "'_", ",_", "'", "Dur", "ation", "'_", "]_", ")_", "._", "size_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Balance", "d", " ", "panel_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "kt_", "=_", "kid", "ne", "y", "\\u", "table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "figure_", "(_", "figsize_", "=_", "(_", "6_", ",_", "6_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "interacti", "on", "\\u", "plot_", "(_", "kt_", "[_", "'", "Weig", "ht", "'_", "]_", ",_", "kt_", "[_", "'", "Dur", "ation", "'_", "]_", ",_", "np_", "._", "log_", "(_", "kt_", "[_", "'", "Day", "s", "'_", "]_", "+_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "colors_", "=_", "[_", "'", "red", "'_", ",_", "'", "blue", "'_", "]_", ",_", "markers_", "=_", "[_", "'", "D", "'_", ",_", "'", "^", "'_", "]_", ",_", "ms_", "=_", "10_", ",_", "ax_", "=_", "plt_", "._", "gca_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "You", " ", "have", " ", "thing", "s", " ", "avail", "able", " ", "in", " ", "the", " ", "calling", " ", "namespace", " ", "avail", "able", " ", "in", " ", "the", " ", "formula", " ", "evaluat", "ion", " ", "namespace_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "kid", "ne", "y", "\\u", "lm_", "=_", "ols_", "(_", "'", "np", ".", "log", "(", "Day", "s", "+", "1", ")", " ", "~", " ", "C", "(", "Dur", "ation", ")", " ", "*", " ", "C", "(", "Weig", "ht", ")'_", ",_", "data_", "=_", "kt_", ")_", "._", "fit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "table", "10_", "=_", "ano", "va", "\\u", "lm_", "(_", "kid", "ne", "y", "\\u", "lm_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "ano", "va", "\\u", "lm_", "(_", "ols_", "(_", "'", "np", ".", "log", "(", "Day", "s", "+", "1", ")", " ", "~", " ", "C", "(", "Dur", "ation", ")", " ", "+", " ", "C", "(", "Weig", "ht", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "kt_", ")_", "._", "fit_", "(_", ")_", ",_", "kid", "ne", "y", "\\u", "lm_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "ano", "va", "\\u", "lm_", "(_", "ols_", "(_", "'", "np", ".", "log", "(", "Day", "s", "+", "1", ")", " ", "~", " ", "C", "(", "Dur", "ation", ")'_", ",_", "data_", "=_", "kt_", ")_", "._", "fit_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ols_", "(_", "'", "np", ".", "log", "(", "Day", "s", "+", "1", ")", " ", "~", " ", "C", "(", "Dur", "ation", ")", " ", "+", " ", "C", "(", "Weig", "ht", ",", " ", "Sum", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "kt_", ")_", "._", "fit_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "ano", "va", "\\u", "lm_", "(_", "ols_", "(_", "'", "np", ".", "log", "(", "Day", "s", "+", "1", ")", " ", "~", " ", "C", "(", "Weig", "ht", ")'_", ",_", "data_", "=_", "kt_", ")_", "._", "fit_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ols_", "(_", "'", "np", ".", "log", "(", "Day", "s", "+", "1", ")", " ", "~", " ", "C", "(", "Dur", "ation", ")", " ", "+", " ", "C", "(", "Weig", "ht", ",", " ", "Sum", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "kt_", ")_", "._", "fit_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "##", " ", "Sum", " ", "of", " ", "squares_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Illu", "strat", "es", " ", "the", " ", "use", " ", "of", " ", "different", " ", "types", " ", "of", " ", "sums", " ", "of", " ", "square", "s", " ", "(", "I", ",", "II", ",", "II", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "and", " ", "how", " ", "the", " ", "Sum", " ", "contrast", " ", "can", " ", "be", " ", "used", " ", "to", " ", "produce", " ", "the", " ", "same", " ", "output", " ", "between_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "the", " ", "3._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Type", "s", " ", "I", " ", "and", " ", "II", " ", "are", " ", "equivalent", " ", "under", " ", "a", " ", "balance", "d", " ", "design", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "Don", "'", "t", " ", "use", " ", "Type", " ", "III", " ", "with", " ", "non", "-", "orthogonal", " ", "contrast", " ", "-", " ", "ie", ".,", " ", "Treat", "ment_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sum", "\\u", "lm_", "=_", "ols_", "(_", "'", "np", ".", "log", "(", "Day", "s", "+", "1", ")", " ", "~", " ", "C", "(", "Dur", "ation", ",", " ", "Sum", ")", " ", "*", " ", "C", "(", "Weig", "ht", ",", " ", "Sum", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "kt_", ")_", "._", "fit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "ano", "va", "\\u", "lm_", "(_", "sum", "\\u", "lm_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "ano", "va", "\\u", "lm_", "(_", "sum", "\\u", "lm_", ",_", "typ_", "=_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "ano", "va", "\\u", "lm_", "(_", "sum", "\\u", "lm_", ",_", "typ_", "=_", "3_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nos", "um", "\\u", "lm_", "=_", "ols_", "(_", "'", "np", ".", "log", "(", "Day", "s", "+", "1", ")", " ", "~", " ", "C", "(", "Dur", "ation", ",", " ", "Treat", "ment", ")", " ", "*", " ", "C", "(", "Weig", "ht", ",", " ", "Treat", "ment", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "kt_", ")_", "._", "fit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "ano", "va", "\\u", "lm_", "(_", "nos", "um", "\\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 ]
Unused import
pyjs/pyjs/examples/mail/Contacts.py
[ { "content": "from pyjamas.ui.Composite import Composite\nfrom pyjamas.ui.HTML import HTML\nfrom pyjamas.ui.HorizontalPanel import HorizontalPanel\nfrom pyjamas.ui.Image import Image\nfrom pyjamas.ui.PopupPanel import PopupPanel\nfrom pyjamas.ui.VerticalPanel import VerticalPanel\nfrom pyjamas.ui.Widget import Widget\nfrom pyjamas.ui.Label import Label\nfrom MailLogger import Logger\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Contact:", "metadata": "root.Contact", "header": "['module', '___EOS___']", "index": 10 }, { "content": " def __init__(self, name, email):\n self.photo = \"http://code.google.com/webtoolkit/documentation/examples/desktopclone/default_photo.jpg\"\n self.name = name\n self.email = email", "metadata": "root.Contact.__init__", "header": "['class', 'Contact', ':', '___EOS___']", "index": 11 }, { "content": "class ContactPopup(PopupPanel):", "metadata": "root.ContactPopup", "header": "['module', '___EOS___']", "index": 16 }, { "content": " def __init__(self, contact):\n # The popup's constructor's argument is a boolean specifying that it\n # auto-close itself when the user clicks outside of it.\n\n PopupPanel.__init__(self, True)\n\n inner = VerticalPanel()\n nameLabel = Label(contact.name)\n emailLabel = Label(contact.email)\n inner.add(nameLabel)\n inner.add(emailLabel)\n\n panel = HorizontalPanel()\n panel.setSpacing(4)\n panel.add(Image(contact.photo))\n panel.add(inner)\n\n self.add(panel)\n self.setStyleName(\"mail-ContactPopup\")\n nameLabel.setStyleName(\"mail-ContactPopupName\")\n emailLabel.setStyleName(\"mail-ContactPopupEmail\")", "metadata": "root.ContactPopup.__init__", "header": "['class', 'ContactPopup', '(', 'PopupPanel', ')', ':', '___EOS___']", "index": 17 }, { "content": "class Contacts(Composite):\n", "metadata": "root.Contacts", "header": "['module', '___EOS___']", "index": 40 }, { "content": " def __init__(self):\n Composite.__init__(self)\n\n self.contacts = []\n self.contacts.append(Contact(\"Benoit Mandelbrot\", \"benoit@example.com\"))\n self.contacts.append(Contact(\"Albert Einstein\", \"albert@example.com\"))\n self.contacts.append(Contact(\"Rene Descartes\", \"rene@example.com\"))\n self.contacts.append(Contact(\"Bob Saget\", \"bob@example.com\"))\n self.contacts.append(Contact(\"Ludwig von Beethoven\", \"ludwig@example.com\"))\n self.contacts.append(Contact(\"Richard Feynman\", \"richard@example.com\"))\n self.contacts.append(Contact(\"Alan Turing\", \"alan@example.com\"))\n self.contacts.append(Contact(\"John von Neumann\", \"john@example.com\"))\n\n self.panel = VerticalPanel()\n\n # Add all the contacts to the list.\n i = 0\n while (i < len(self.contacts)):\n self.addContact(self.contacts[i])\n i = i + 1\n\n self.initWidget(self.panel)\n self.setStyleName(\"mail-Contacts\")", "metadata": "root.Contacts.__init__", "header": "['class', 'Contacts', '(', 'Composite', ')', ':', '___EOS___']", "index": 41 }, { "content": " def addContact(self, contact):\n link = HTML(\"<a href='javascript:;'>\" + contact.name + \"</a>\")\n self.panel.add(link)\n\n # Add a click listener that displays a ContactPopup when it is clicked.\n listener = ContactListener(contact, link)\n link.addClickListener(listener)", "metadata": "root.Contacts.addContact", "header": "['class', 'Contacts', '(', 'Composite', ')', ':', '___EOS___']", "index": 65 }, { "content": "class ContactListener:\n", "metadata": "root.ContactListener", "header": "['module', '___EOS___']", "index": 73 }, { "content": " def __init__(self, contact, link):\n self.cont = contact\n self.link = link", "metadata": "root.ContactListener.__init__", "header": "['class', 'ContactListener', ':', '___EOS___']", "index": 74 }, { "content": " def onClick(self, sender):\n if (sender == self.link):\n popup = ContactPopup(self.cont)\n left = self.link.getAbsoluteLeft() + 32\n top = self.link.getAbsoluteTop() + 8\n popup.setPopupPosition(left, top)\n popup.show()", "metadata": "root.ContactListener.onClick", "header": "['class', 'ContactListener', ':', '___EOS___']", "index": 78 } ]
[ { "span": "from pyjamas.ui.Widget import Widget", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 36 }, { "span": "from MailLogger import Logger", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 29 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "._", "Composit", "e_", "import_", "Composit", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "._", "HTML_", "import_", "HTML_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "._", "Horiz", "onta", "l", "Panel_", "import_", "Horiz", "onta", "l", "Panel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "._", "Image_", "import_", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "._", "Pop", "up", "Panel_", "import_", "Pop", "up", "Panel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "._", "Vertica", "l", "Panel_", "import_", "Vertica", "l", "Panel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "._", "Widget_", "import_", "Widget_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyj", "ama", "s_", "._", "ui_", "._", "Label_", "import_", "Label_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "Mail", "Logger_", "import_", "Logger_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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\\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_", "Contact_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Contact_", ":_", "\\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_", ",_", "name_", ",_", "email_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "photo_", "=_", "\"", "http", "://", "code", ".", "google", ".", "com", "/", "web", "tool", "kit", "/", "documentation", "/", "example", "s", "/", "desk", "top", "clone", "/", "default", "\\u", "photo", ".", "jp", "g", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "email_", "=_", "email_", "\\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_", "Conta", "ct", "Popup_", "(_", "Pop", "up", "Panel_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Conta", "ct", "Popup_", "(_", "Pop", "up", "Panel_", ")_", ":_", "\\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_", ",_", "contact_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "popu", "p", "'", "s", " ", "construct", "or", "'", "s", " ", "argu", "ment", " ", "is", " ", "a", " ", "boolean", " ", "speci", "fy", "ing", " ", "tha", "t", " ", "it_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "auto", "-", "close", " ", "its", "elf", " ", "whe", "n", " ", "the", " ", "user", " ", "clicks", " ", "outsi", "de", " ", "of", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Pop", "up", "Panel_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "inner_", "=_", "Vertica", "l", "Panel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Label_", "=_", "Label_", "(_", "contact_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "email", "Label_", "=_", "Label_", "(_", "contact_", "._", "email_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inner_", "._", "add_", "(_", "name", "Label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "inner_", "._", "add_", "(_", "email", "Label_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "panel_", "=_", "Horiz", "onta", "l", "Panel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "panel_", "._", "set", "Spacing_", "(_", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "panel_", "._", "add_", "(_", "Image_", "(_", "contact_", "._", "photo_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "panel_", "._", "add_", "(_", "inner_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add_", "(_", "panel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Style", "Name_", "(_", "\"", "mail", "-", "Conta", "ct", "Pop", "up", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name", "Label_", "._", "set", "Style", "Name_", "(_", "\"", "mail", "-", "Conta", "ct", "Pop", "up", "Name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "email", "Label_", "._", "set", "Style", "Name_", "(_", "\"", "mail", "-", "Conta", "ct", "Pop", "up", "Ema", "il", "\"_", ")_", "\\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_", "Conta", "cts_", "(_", "Composit", "e_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Conta", "cts_", "(_", "Composit", "e_", ")_", ":_", "\\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_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Composit", "e_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "contacts_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "contacts_", "._", "append_", "(_", "Contact_", "(_", "\"", "Ben", "oi", "t", " ", "Man", "del", "bro", "t", "\"_", ",_", "\"", "ben", "oi", "t", "@", "example", ".", "com", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "contacts_", "._", "append_", "(_", "Contact_", "(_", "\"", "Alb", "ert", " ", "Ein", "stei", "n", "\"_", ",_", "\"", "albe", "rt", "@", "example", ".", "com", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "contacts_", "._", "append_", "(_", "Contact_", "(_", "\"", "Ren", "e", " ", "Des", "cart", "es", "\"_", ",_", "\"", "ren", "e", "@", "example", ".", "com", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "contacts_", "._", "append_", "(_", "Contact_", "(_", "\"", "Bob", " ", "Sag", "et", "\"_", ",_", "\"", "bob", "@", "example", ".", "com", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "contacts_", "._", "append_", "(_", "Contact_", "(_", "\"", "Lu", "dwi", "g", " ", "vo", "n", " ", "Bee", "tho", "ven", "\"_", ",_", "\"", "lud", "wig", "@", "example", ".", "com", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "contacts_", "._", "append_", "(_", "Contact_", "(_", "\"", "Rich", "ard", " ", "Fe", "yn", "man", "\"_", ",_", "\"", "rich", "ard", "@", "example", ".", "com", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "contacts_", "._", "append_", "(_", "Contact_", "(_", "\"", "Ala", "n", " ", "Tur", "ing", "\"_", ",_", "\"", "alan", "@", "example", ".", "com", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "contacts_", "._", "append_", "(_", "Contact_", "(_", "\"", "Joh", "n", " ", "vo", "n", " ", "Neu", "man", "n", "\"_", ",_", "\"", "john", "@", "example", ".", "com", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "panel_", "=_", "Vertica", "l", "Panel_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "all", " ", "the", " ", "contact", "s", " ", "to", " ", "the", " ", "list", "._", "\\u\\u\\uNL\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "(_", "i_", "<_", "len_", "(_", "self_", "._", "contacts_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "add", "Contact_", "(_", "self_", "._", "contacts_", "[_", "i_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "i_", "=_", "i_", "+_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "init", "Widget_", "(_", "self_", "._", "panel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Style", "Name_", "(_", "\"", "mail", "-", "Conta", "ct", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Conta", "cts_", "(_", "Composit", "e_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Contact_", "(_", "self_", ",_", "contact_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "link_", "=_", "HTML_", "(_", "\"<", "a", " ", "href", "='", "javascript", ":", ";'", ">\"_", "+_", "contact_", "._", "name_", "+_", "\"<", "/", "a", ">\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "panel_", "._", "add_", "(_", "link_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "a", " ", "click", " ", "listen", "er", " ", "tha", "t", " ", "display", "s", " ", "a", " ", "Conta", "ct", "Pop", "up", " ", "whe", "n", " ", "it", " ", "is", " ", "click", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "listener_", "=_", "Conta", "ct", "Listener_", "(_", "contact_", ",_", "link_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "link_", "._", "add", "Click", "Listener_", "(_", "listener_", ")_", "\\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_", "Conta", "ct", "Listener_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Conta", "ct", "Listener_", ":_", "\\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_", ",_", "contact_", ",_", "link_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cont_", "=_", "contact_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "link_", "=_", "link_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Conta", "ct", "Listener_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "on", "Click_", "(_", "self_", ",_", "sender_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "sender_", "==_", "self_", "._", "link_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "popup_", "=_", "Conta", "ct", "Popup_", "(_", "self_", "._", "cont_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left_", "=_", "self_", "._", "link_", "._", "get", "Abs", "olute", "Left_", "(_", ")_", "+_", "32_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "=_", "self_", "._", "link_", "._", "get", "Abs", "olute", "Top_", "(_", ")_", "+_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "popup_", "._", "set", "Pop", "up", "Position_", "(_", "left_", ",_", "top_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "popup_", "._", "show_", "(_", ")_" ]
[ 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, 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, 4, 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, 4, 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, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
balanced/status.balancedpayments.com/venv/lib/python2.7/site-packages/twilio/compat/__init__.py
[ { "content": "\n# Those are not supported by the six library and needs to be done manually\nfrom six import binary_type\n\ntry:\n # python 3\n from urllib.parse import urlencode, urlparse, urljoin\nexcept ImportError:\n # python 2 backward compatibility\n #noinspection PyUnresolvedReferences\n from urllib import urlencode\n #noinspection PyUnresolvedReferences\n from urlparse import urlparse, urljoin\n\ntry:\n # python 2\n from itertools import izip\nexcept ImportError:\n # python 3\n izip = zip\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from six import binary_type", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 27 }, { "span": "from urllib.parse import urlencode, urlparse, urljoin", "start_line": 6, "start_column": 4, "end_line": 6, "end_column": 57 }, { "span": "from urlparse import urlparse, urljoin", "start_line": 12, "start_column": 4, "end_line": 12, "end_column": 42 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tho", "se", " ", "are", " ", "not", " ", "support", "ed", " ", "by", " ", "the", " ", "si", "x", " ", "librar", "y", " ", "and", " ", "need", "s", " ", "to", " ", "be", " ", "don", "e", " ", "manu", "ally", "_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "six_", "import_", "binar", "y", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "python", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "urllib_", "._", "parse_", "import_", "urlencode_", ",_", "urlparse_", ",_", "urljoin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "python", " ", "2", " ", "back", "ward", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "noin", "spect", "ion", " ", "Py", "Unre", "solved", "Reference", "s_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "urllib_", "import_", "urlencode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "noin", "spect", "ion", " ", "Py", "Unre", "solved", "Reference", "s_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "urlparse_", "import_", "urlparse_", ",_", "urljoin_", "\\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_", "#", " ", "python", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "itertools_", "import_", "izip_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "python", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "izip_", "=_", "zip_", "\\u\\u\\uDEDENT\\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, 0, 1, 1, 1, 1, 1, 1, 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, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
priestc/giotto/giotto/views/__init__.py
[ { "content": "import os\nimport json\nimport mimeparse\nimport inspect\n\nfrom jinja2 import Template, DebugUndefined, Environment, PackageLoader, FileSystemLoader\nfrom jinja2.exceptions import TemplateNotFound\n\nfrom giotto import get_config\nfrom giotto.exceptions import NoViewMethod\nfrom giotto.utils import Mock, htmlize, htmlize_list, pre_process_json, super_accept_to_mimetype, jsonify\nfrom giotto.control import GiottoControl, Redirection\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def renders(*mimetypes):\n def decorator(func):\n func.mimetypes = []\n for mimetype in mimetypes:\n func.mimetypes.append(mimetype)\n return func\n return decorator", "metadata": "root.renders", "header": "['module', '___EOS___']", "index": 13 }, { "content": "class GiottoView(object):\n \"\"\"\n Base class for all Giotto view objects. All Giotto Views must at least descend\n from this class, as ths class contains piping that the controller calls.\n \"\"\"\n\n\n\n\n", "metadata": "root.GiottoView", "header": "['module', '___EOS___']", "index": 21 }, { "content": " def __init__(self, persist=None, **kwargs):\n self.persist = persist\n self.render_map = {} # renderers by mimetype\n self.reject_map = {} # renderers by name (no corresponding mimetype)\n class_defined_renderers = [x for x in dir(self) if not x.startswith('__')]\n self._register_renderers(class_defined_renderers)\n\n for format, function in kwargs.items():\n ## key word arguments can be passed into the constructor to\n ## override render methods from within the manifest.\n ## set 'mimetypes' as if it were using the @renders decorator\n mime = super_accept_to_mimetype(format)\n setattr(function, 'mimetypes', [mime or format])\n setattr(self, format, function)\n\n # kwarg renderers kill any render methods that are defined by the class\n self._register_renderers(kwargs.keys())", "metadata": "root.GiottoView.__init__", "header": "['class', 'GiottoView', '(', 'object', ')', ':', '___EOS___']", "index": 27 }, { "content": " def _register_renderers(self, attrs):\n \"\"\"\n Go through the passed in list of attributes and register those renderers\n in the render map.\n \"\"\"\n for method in attrs:\n func = getattr(self, method)\n mimetypes = getattr(func, 'mimetypes', [])\n for mimetype in mimetypes:\n if not '/' in mimetype:\n self.reject_map[mimetype] = func\n if mimetype not in self.render_map:\n self.render_map[mimetype] = func\n else:\n # about to redefine an already defined renderer.\n # make sure this new render method is not on a base class.\n base_classes = self.__class__.mro()[1:]\n from_baseclass = any([x for x in base_classes if func.__name__ in dir(x)])\n if not from_baseclass:\n self.render_map[mimetype] = func", "metadata": "root.GiottoView._register_renderers", "header": "['class', 'GiottoView', '(', 'object', ')', ':', '___EOS___']", "index": 45 }, { "content": " def can_render(self, partial_mimetype):\n \"\"\"\n Given a partial mimetype (such as 'json' or 'html'), return if the \n view can render that type.\n \"\"\"\n for mime in self.render_map.keys():\n if mime == '*/*':\n return True\n if partial_mimetype in mime:\n return True\n return False", "metadata": "root.GiottoView.can_render", "header": "['class', 'GiottoView', '(', 'object', ')', ':', '___EOS___']", "index": 67 }, { "content": " def render(self, result, mimetype, errors=None):\n \"\"\"\n Render a model result into `mimetype` format.\n \"\"\"\n available_mimetypes = [x for x in self.render_map.keys() if '/' in x]\n render_func = None\n\n if '/' not in mimetype:\n # naked superformat (does not correspond to a mimetype)\n render_func = self.reject_map.get(mimetype, None)\n if not render_func:\n raise NoViewMethod(\"Unknown Superformat: %s\" % mimetype)\n\n if not render_func and available_mimetypes:\n target_mimetype = mimeparse.best_match(available_mimetypes, mimetype)\n render_func = self.render_map.get(target_mimetype, None)\n\n if not render_func:\n raise NoViewMethod(\"%s not supported for this program\" % mimetype)\n\n principle_mimetype = render_func.mimetypes[0]\n\n if GiottoControl in render_func.__class__.mro():\n # redirection defined as view (not wrapped in lambda)\n return {'body': render_func, 'persist': render_func.persist}\n\n if callable(self.persist):\n # persist (cookie data) can be either an object, or a callable)\n persist = self.persist(result)\n else:\n persist = self.persist\n\n # render functins can take either one or two arguments, both are\n # supported by the API\n arg_names = inspect.getargspec(render_func).args\n num_args = len(set(arg_names) - set(['self', 'cls']))\n if num_args == 2:\n data = render_func(result, errors or Mock())\n else:\n # if the renderer only has one argument, don't pass in the 2nd arg.\n data = render_func(result)\n\n if GiottoControl in data.__class__.mro():\n # render function returned a control object\n return {'body': data, 'persist': persist}\n\n if not hasattr(data, 'items'):\n # view returned string\n data = {'body': data, 'mimetype': principle_mimetype}\n else:\n # result is a dict in for form {body: XX, mimetype: xx}\n if not 'mimetype' in data and target_mimetype == '*/*':\n data['mimetype'] = ''\n\n if not 'mimetype' in data:\n data['mimetype'] = target_mimetype\n\n data['persist'] = persist\n return data", "metadata": "root.GiottoView.render", "header": "['class', 'GiottoView', '(', 'object', ')', ':', '___EOS___']", "index": 79 }, { "content": "class BasicView(GiottoView):\n \"\"\"\n Basic viewer that contains generic functionality for showing any data.\n \"\"\"\n\n", "metadata": "root.BasicView", "header": "['module', '___EOS___']", "index": 139 }, { "content": " @renders('application/json')\n def generic_json(self, result, errors):\n return {'body': jsonify(result), 'mimetype': 'application/json'}", "metadata": "root.BasicView.generic_json", "header": "['class', 'BasicView', '(', 'GiottoView', ')', ':', '___EOS___']", "index": 143 }, { "content": " @renders('text/html')\n def generic_html(self, result, errors):\n \"\"\"\n Try to display any object in sensible HTML.\n \"\"\"\n h1 = htmlize(type(result))\n out = []\n result = pre_process_json(result)\n\n if not hasattr(result, 'items'):\n # result is a non-container\n header = \"<tr><th>Value</th></tr>\"\n if type(result) is list:\n result = htmlize_list(result)\n else:\n result = htmlize(result)\n out = [\"<tr><td>\" + result + \"</td></tr>\"]\n elif hasattr(result, 'lower'):\n out = [\"<tr><td>\" + result + \"</td></tr>\"]\n else:\n # object is a dict\n header = \"<tr><th>Key</th><th>Value</th></tr>\"\n for key, value in result.items():\n v = htmlize(value)\n row = \"<tr><td>{0}</td><td>{1}</td></tr>\".format(key, v)\n out.append(row)\n\n env = Environment(loader=PackageLoader('giotto'))\n template = env.get_template('generic.html')\n rendered = template.render({'header': h1, 'table_header': header, 'table_body': out})\n return {'body': rendered, 'mimetype': 'text/html'}", "metadata": "root.BasicView.generic_html", "header": "['class', 'BasicView', '(', 'GiottoView', ')', ':', '___EOS___']", "index": 147 }, { "content": " @renders('text/plain', 'text/x-cmd', 'text/x-irc')\n def generic_text(self, result, errors):\n out = []\n kv_iterate = None\n single_iterate = []\n if hasattr(result, 'items'):\n #is a dict\n kv_iterate = result.items()\n elif hasattr(result, 'lower'):\n # is just a plain string\n return result\n elif not result:\n # is a Nonetype\n return ''\n elif hasattr(result, 'append'):\n # is a list\n single_iterate = result\n elif hasattr(result, 'todict'):\n # is a model object\n kv_iterate = result.todict().items()\n else:\n # generic object\n kv_iterate = result.__dict__.items()\n\n if kv_iterate:\n for key, value in kv_iterate:\n row = \"{0} - {1}\".format(key, value)\n out.append(row)\n else:\n for value in single_iterate:\n out.append(self.generic_text(value, None))\n\n return \"\\n\".join(out)", "metadata": "root.BasicView.generic_text", "header": "['class', 'BasicView', '(', 'GiottoView', ')', ':', '___EOS___']", "index": 179 }, { "content": "def get_jinja_template(template_name):\n ppx = get_config('project_path')\n env = Environment(loader=FileSystemLoader(os.path.join(ppx, 'views'))) \n return env.get_template(template_name)", "metadata": "root.get_jinja_template", "header": "['module', '___EOS___']", "index": 213 }, { "content": "def jinja_template(template_name, name='data', mimetype=\"text/html\"):\n \"\"\"\n Meta-renderer for rendering jinja templates\n \"\"\"\n def jinja_renderer(result, errors):\n template = get_jinja_template(template_name)\n context = {name: result or Mock(), 'errors': errors, 'enumerate': enumerate}\n rendered = template.render(**context)\n return {'body': rendered, 'mimetype': mimetype}\n return jinja_renderer", "metadata": "root.jinja_template", "header": "['module', '___EOS___']", "index": 218 }, { "content": "def partial_jinja_template(template_name, name='data', mimetype=\"text/html\"):\n \"\"\"\n Partial render of jinja templates. This is useful if you want to re-render\n the template in the output middleware phase.\n These templates are rendered in a way that all undefined variables will be \n kept in the emplate intact.\n \"\"\"\n def partial_jinja_renderer(result, errors):\n template = get_jinja_template(template_name)\n old = template.environment.undefined\n template.environment.undefined = DebugUndefined\n context = {name: result or Mock(), 'errors': errors}\n rendered = template.render(**context)\n template.environment.undefined = old\n return {'body': rendered, 'mimetype': mimetype}\n return partial_jinja_renderer", "metadata": "root.partial_jinja_template", "header": "['module', '___EOS___']", "index": 230 }, { "content": "def lazy_jinja_template(template_name, name='data', mimetype='text/html'):\n \"\"\"\n Jinja template renderer that does not render the template at all.\n Instead of returns the context and template object blended together.\n Make sure to add ``giotto.middleware.RenderLazytemplate`` to the output\n middleware stread of any program that uses this renderer.\n \"\"\"\n def lazy_jinja_renderer(result, errors):\n template = get_jinja_template(template_name)\n context = {name: result or Mock(), 'errors': errors}\n data = ('jinja2', template, context)\n return {'body': data, 'mimetype': mimetype}\n return lazy_jinja_renderer", "metadata": "root.lazy_jinja_template", "header": "['module', '___EOS___']", "index": 248 }, { "content": "class ImageViewer(GiottoView):\n \"\"\"\n For viewing images. The 'result' must be a file object that contains image\n data (doesn't matter the format).\n \"\"\"\n\n\n\n\n", "metadata": "root.ImageViewer", "header": "['module', '___EOS___']", "index": 263 }, { "content": " @renders('text/plain')\n def plaintext(self, result):\n \"\"\"\n Converts the image object into an ascii representation. Code taken from\n http://a-eter.blogspot.com/2010/04/image-to-ascii-art-in-python.html\n \"\"\"\n from PIL import Image\n\n ascii_chars = ['#', 'A', '@', '%', 'S', '+', '<', '*', ':', ',', '.']\n\n def image_to_ascii(image):\n image_as_ascii = []\n all_pixels = list(image.getdata())\n for pixel_value in all_pixels:\n index = pixel_value / 25 # 0 - 10\n image_as_ascii.append(ascii_chars[index])\n return image_as_ascii \n\n img = Image.open(result)\n width, heigth = img.size\n new_width = 80 \n new_heigth = int((heigth * new_width) / width)\n new_image = img.resize((new_width, new_heigth))\n new_image = new_image.convert(\"L\") # convert to grayscale\n\n # now that we have a grayscale image with some fixed width we have to convert every pixel\n # to the appropriate ascii character from \"ascii_chars\"\n img_as_ascii = image_to_ascii(new_image)\n img_as_ascii = ''.join(ch for ch in img_as_ascii)\n out = []\n for c in range(0, len(img_as_ascii), new_width):\n out.append(img_as_ascii[c:c+new_width])\n\n return \"\\n\".join(out)", "metadata": "root.ImageViewer.plaintext", "header": "['class', 'ImageViewer', '(', 'GiottoView', ')', ':', '___EOS___']", "index": 269 }, { "content": " def image(self, result):\n return result", "metadata": "root.ImageViewer.image", "header": "['class', 'ImageViewer', '(', 'GiottoView', ')', ':', '___EOS___']", "index": 304 }, { "content": " def image_jpeg(self, result):\n return self.image(result)", "metadata": "root.ImageViewer.image_jpeg", "header": "['class', 'ImageViewer', '(', 'GiottoView', ')', ':', '___EOS___']", "index": 307 }, { "content": " def text_cmd(self, result):\n return result.read()", "metadata": "root.ImageViewer.text_cmd", "header": "['class', 'ImageViewer', '(', 'GiottoView', ')', ':', '___EOS___']", "index": 310 }, { "content": " def text_html(self, result):\n return \"\"\"<!DOCTYPE html>\n <html>\n <body>\n <img src=\"/multiply?x=4&y=7\">\n </body>\n </html>\"\"\"", "metadata": "root.ImageViewer.text_html", "header": "['class', 'ImageViewer', '(', 'GiottoView', ')', ':', '___EOS___']", "index": 313 }, { "content": "class URLFollower(BasicView):\n \"\"\"\n For visualizing programs that return a url\n \"\"\"\n", "metadata": "root.URLFollower", "header": "['module', '___EOS___']", "index": 321 }, { "content": " @renders(\"text/html\")\n def text_html(self, data):\n return Redirection(data)", "metadata": "root.URLFollower.text_html", "header": "['class', 'URLFollower', '(', 'BasicView', ')', ':', '___EOS___']", "index": 325 }, { "content": " def cmd(self, data):\n # execute browser and give it the url\n return \"\"", "metadata": "root.URLFollower.cmd", "header": "['class', 'URLFollower', '(', 'BasicView', ')', ':', '___EOS___']", "index": 329 }, { "content": "class ForceJSONView(GiottoView):\n \"\"\"\n All objects going through this View will be displayed as JSON no matter what.\n \"\"\"", "metadata": "root.ForceJSONView", "header": "['module', '___EOS___']", "index": 333 }, { "content": " @renders(\"*/*\")\n def renderer(self, data, errors):\n return jsonify(data)", "metadata": "root.ForceJSONView.renderer", "header": "['class', 'ForceJSONView', '(', 'GiottoView', ')', ':', '___EOS___']", "index": 337 }, { "content": "class ForceTextView(GiottoView):", "metadata": "root.ForceTextView", "header": "['module', '___EOS___']", "index": 341 }, { "content": " @renders(\"*/*\")\n def renderer(self, data, errors):\n return self.generic_text(data)", "metadata": "root.ForceTextView.renderer", "header": "['class', 'ForceTextView', '(', 'GiottoView', ')', ':', '___EOS___']", "index": 342 } ]
[ { "span": "import json", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 11 }, { "span": "from jinja2 import Template, DebugUndefined, Environment, PackageLoader, FileSystemLoader", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 89 }, { "span": "from jinja2.exceptions import TemplateNotFound", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 46 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "mime", "parse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "inspect_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "jinja2_", "import_", "Template_", ",_", "Deb", "ug", "Unde", "fined", "_", ",_", "Environment_", ",_", "Packa", "ge", "Loader_", ",_", "File", "System", "Loader_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "jinja2_", "._", "exceptions_", "import_", "Templa", "te", "Not", "Found_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "gio", "tto", "_", "import_", "get", "\\u", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gio", "tto", "_", "._", "exceptions_", "import_", "No", "View", "Method_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gio", "tto", "_", "._", "utils_", "import_", "Mock_", ",_", "html", "ize_", ",_", "html", "ize", "\\u", "list_", ",_", "pre", "\\u", "process", "\\u", "json_", ",_", "super", "\\u", "accept", "\\u", "to", "\\u", "mimetype_", ",_", "jsonify_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gio", "tto", "_", "._", "control_", "import_", "Gi", "ott", "o", "Control_", ",_", "Redirect", "ion_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "render", "s_", "(_", "*_", "mimetypes_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "decorator_", "(_", "func_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "func_", "._", "mimetypes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "mimetype_", "in_", "mimetypes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "func_", "._", "mimetypes_", "._", "append_", "(_", "mimetype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "decorator_", "\\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_", "Gi", "ott", "o", "View_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Base", " ", "class", " ", "for", " ", "all", " ", "Gi", "ott", "o", " ", "view", " ", "object", "s", ".", " ", "All", " ", "Gi", "ott", "o", " ", "View", "s", " ", "must", " ", "at", " ", "leas", "t", " ", "descend", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "this", " ", "class", ",", " ", "as", " ", "ths", " ", "class", " ", "contain", "s", " ", "pip", "ing", " ", "tha", "t", " ", "the", " ", "controlle", "r", " ", "calls", ".", "\\", "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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Gi", "ott", "o", "View_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "persist_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "persist_", "=_", "persist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "render", "\\u", "map_", "=_", "{_", "}_", "#", " ", "render", "ers", " ", "by", " ", "mimetype_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reject", "\\u", "map_", "=_", "{_", "}_", "#", " ", "render", "ers", " ", "by", " ", "name", " ", "(", "no", " ", "correspond", "ing", " ", "mime", "type", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class", "\\u", "defin", "ed", "\\u", "renderers_", "=_", "[_", "x_", "for_", "x_", "in_", "dir_", "(_", "self_", ")_", "if_", "not_", "x_", "._", "startswith_", "(_", "'\\u\\u'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "register", "\\u", "renderers_", "(_", "class", "\\u", "defin", "ed", "\\u", "renderers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "format_", ",_", "function_", "in_", "kwargs_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "##", " ", "key", " ", "word", " ", "argu", "ment", "s", " ", "can", " ", "be", " ", "pass", "ed", " ", "int", "o", " ", "the", " ", "construct", "or", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "override", " ", "render", " ", "method", "s", " ", "from", " ", "within", " ", "the", " ", "manifest", "._", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "set", " ", "'", "mime", "types", "'", " ", "as", " ", "if", " ", "it", " ", "wer", "e", " ", "usi", "ng", " ", "the", " ", "@", "render", "s", " ", "decorator_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mime_", "=_", "super", "\\u", "accept", "\\u", "to", "\\u", "mimetype_", "(_", "format_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "setattr_", "(_", "function_", ",_", "'", "mime", "types", "'_", ",_", "[_", "mime_", "or_", "format_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "setattr_", "(_", "self_", ",_", "format_", ",_", "function_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "kwarg", " ", "render", "ers", " ", "kill", " ", "any", " ", "render", " ", "method", "s", " ", "tha", "t", " ", "are", " ", "defin", "ed", " ", "by", " ", "the", " ", "class_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "register", "\\u", "renderers_", "(_", "kwargs_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gi", "ott", "o", "View_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "register", "\\u", "renderers_", "(_", "self_", ",_", "attrs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Go", " ", "through", " ", "the", " ", "pass", "ed", " ", "in", " ", "list", " ", "of", " ", "attribute", "s", " ", "and", " ", "register", " ", "tho", "se", " ", "render", "ers", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "the", " ", "render", " ", "map", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "method_", "in_", "attrs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "func_", "=_", "getattr_", "(_", "self_", ",_", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mimetypes_", "=_", "getattr_", "(_", "func_", ",_", "'", "mime", "types", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "mimetype_", "in_", "mimetypes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "'/'_", "in_", "mimetype_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "reject", "\\u", "map_", "[_", "mimetype_", "]_", "=_", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "mimetype_", "not_", "in_", "self_", "._", "render", "\\u", "map_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "render", "\\u", "map_", "[_", "mimetype_", "]_", "=_", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "abo", "ut", " ", "to", " ", "rede", "fine", " ", "an", " ", "alr", "ead", "y", " ", "defin", "ed", " ", "render", "er", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "this", " ", "new", " ", "render", " ", "method", " ", "is", " ", "not", " ", "on", " ", "a", " ", "base", " ", "class", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "base", "\\u", "classes_", "=_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "mro", "_", "(_", ")_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from", "\\u", "basec", "lass_", "=_", "any_", "(_", "[_", "x_", "for_", "x_", "in_", "base", "\\u", "classes_", "if_", "func_", "._", "\\u\\u", "name\\u\\u_", "in_", "dir_", "(_", "x_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "from", "\\u", "basec", "lass_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "self_", "._", "render", "\\u", "map_", "[_", "mimetype_", "]_", "=_", "func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gi", "ott", "o", "View_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "can", "\\u", "render_", "(_", "self_", ",_", "partial", "\\u", "mimetype_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Give", "n", " ", "a", " ", "partial", " ", "mime", "type", " ", "(", "suc", "h", " ", "as", " ", "'", "json", "'", " ", "or", " ", "'", "html", "')", ",", " ", "return", " ", "if", " ", "the", " ", "\\", "10", ";", " ", " ", " ", " ", "view", " ", "can", " ", "render", " ", "tha", "t", " ", "type", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "mime_", "in_", "self_", "._", "render", "\\u", "map_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "mime_", "==_", "'*/", "*'_", ":_", "\\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_", "if_", "partial", "\\u", "mimetype_", "in_", "mime_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Gi", "ott", "o", "View_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "render_", "(_", "self_", ",_", "result_", ",_", "mimetype_", ",_", "errors_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Render", " ", "a", " ", "model", " ", "result", " ", "int", "o", " ", "`", "mime", "type", "`", " ", "format", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "avail", "able", "\\u", "mimetypes_", "=_", "[_", "x_", "for_", "x_", "in_", "self_", "._", "render", "\\u", "map_", "._", "keys_", "(_", ")_", "if_", "'/'_", "in_", "x_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "render", "\\u", "func_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'/'_", "not_", "in_", "mimetype_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "nak", "ed", " ", "super", "format", " ", "(", "doe", "s", " ", "not", " ", "correspond", " ", "to", " ", "a", " ", "mime", "type", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "render", "\\u", "func_", "=_", "self_", "._", "reject", "\\u", "map_", "._", "get_", "(_", "mimetype_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "render", "\\u", "func_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "No", "View", "Method_", "(_", "\"", "Un", "know", "n", " ", "Super", "format", ":", " ", "%", "s", "\"_", "%_", "mimetype_", ")_", "\\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_", "render", "\\u", "func_", "and_", "avail", "able", "\\u", "mimetypes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "target", "\\u", "mimetype_", "=_", "mime", "parse_", "._", "best", "\\u", "match_", "(_", "avail", "able", "\\u", "mimetypes_", ",_", "mimetype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "render", "\\u", "func_", "=_", "self_", "._", "render", "\\u", "map_", "._", "get_", "(_", "target", "\\u", "mimetype_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "render", "\\u", "func_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "No", "View", "Method_", "(_", "\"%", "s", " ", "not", " ", "support", "ed", " ", "for", " ", "this", " ", "program", "\"_", "%_", "mimetype_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "princ", "ipl", "e\\u", "mimetype_", "=_", "render", "\\u", "func_", "._", "mimetypes_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "Gi", "ott", "o", "Control_", "in_", "render", "\\u", "func_", "._", "\\u\\u", "class\\u\\u_", "._", "mro", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "redirection", " ", "defin", "ed", " ", "as", " ", "view", " ", "(", "not", " ", "wrapp", "ed", " ", "in", " ", "lambda", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "body", "'_", ":_", "render", "\\u", "func_", ",_", "'", "persist", "'_", ":_", "render", "\\u", "func_", "._", "persist_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "callable_", "(_", "self_", "._", "persist_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "persist", " ", "(", "cookie", " ", "data", ")", " ", "can", " ", "be", " ", "eit", "her", " ", "an", " ", "object", ",", " ", "or", " ", "a", " ", "calla", "ble", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "persist_", "=_", "self_", "._", "persist_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "persist_", "=_", "self_", "._", "persist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "render", " ", "funct", "ins", " ", "can", " ", "take", " ", "eit", "her", " ", "one", " ", "or", " ", "two", " ", "argu", "ment", "s", ",", " ", "bot", "h", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "support", "ed", " ", "by", " ", "the", " ", "API_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "arg", "\\u", "names_", "=_", "inspect_", "._", "getargs", "pec_", "(_", "render", "\\u", "func_", ")_", "._", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "args_", "=_", "len_", "(_", "set_", "(_", "arg", "\\u", "names_", ")_", "-_", "set_", "(_", "[_", "'", "self", "'_", ",_", "'", "cls", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "num", "\\u", "args_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "render", "\\u", "func_", "(_", "result_", ",_", "errors_", "or_", "Mock_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "the", " ", "render", "er", " ", "only", " ", "has", " ", "one", " ", "argu", "ment", ",", " ", "don", "'", "t", " ", "pass", " ", "in", " ", "the", " ", "2n", "d", " ", "arg", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "render", "\\u", "func_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "Gi", "ott", "o", "Control_", "in_", "data_", "._", "\\u\\u", "class\\u\\u_", "._", "mro", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "render", " ", "function", " ", "return", "ed", " ", "a", " ", "control", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "body", "'_", ":_", "data_", ",_", "'", "persist", "'_", ":_", "persist_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "hasattr_", "(_", "data_", ",_", "'", "items", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "view", " ", "return", "ed", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "{_", "'", "body", "'_", ":_", "data_", ",_", "'", "mime", "type", "'_", ":_", "princ", "ipl", "e\\u", "mimetype_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "result", " ", "is", " ", "a", " ", "dict", " ", "in", " ", "for", " ", "form", " ", "{", "body", ":", " ", "XX", ",", " ", "mime", "type", ":", " ", "xx", "}_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "'", "mime", "type", "'_", "in_", "data_", "and_", "target", "\\u", "mimetype_", "==_", "'*/", "*'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "mime", "type", "'_", "]_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "'", "mime", "type", "'_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "'", "mime", "type", "'_", "]_", "=_", "target", "\\u", "mimetype_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "[_", "'", "persist", "'_", "]_", "=_", "persist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Basic", "View_", "(_", "Gi", "ott", "o", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Basic", " ", "viewer", " ", "tha", "t", " ", "contain", "s", " ", "gener", "ic", " ", "functional", "it", "y", " ", "for", " ", "showin", "g", " ", "any", " ", "data", ".", "\\", "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_", "Basic", "View_", "(_", "Gi", "ott", "o", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "render", "s_", "(_", "'", "applica", "tion", "/", "json", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "gener", "ic", "\\u", "json_", "(_", "self_", ",_", "result_", ",_", "errors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "{_", "'", "body", "'_", ":_", "jsonify_", "(_", "result_", ")_", ",_", "'", "mime", "type", "'_", ":_", "'", "applica", "tion", "/", "json", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "View_", "(_", "Gi", "ott", "o", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "render", "s_", "(_", "'", "text", "/", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "gener", "ic", "\\u", "html_", "(_", "self_", ",_", "result_", ",_", "errors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Tr", "y", " ", "to", " ", "display", " ", "any", " ", "object", " ", "in", " ", "sensi", "ble", " ", "HTM", "L", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "h1_", "=_", "html", "ize_", "(_", "type_", "(_", "result_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "pre", "\\u", "process", "\\u", "json_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "hasattr_", "(_", "result_", ",_", "'", "items", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "result", " ", "is", " ", "a", " ", "non", "-", "container_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "=_", "\"<", "tr", "><", "th", ">", "Value", "</", "th", "><", "/", "tr", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "type_", "(_", "result_", ")_", "is_", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "html", "ize", "\\u", "list_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "html", "ize_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "out_", "=_", "[_", "\"<", "tr", "><", "td", ">\"_", "+_", "result_", "+_", "\"<", "/", "td", "><", "/", "tr", ">\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "hasattr_", "(_", "result_", ",_", "'", "lower", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "=_", "[_", "\"<", "tr", "><", "td", ">\"_", "+_", "result_", "+_", "\"<", "/", "td", "><", "/", "tr", ">\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "object", " ", "is", " ", "a", " ", "dict_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "header_", "=_", "\"<", "tr", "><", "th", ">", "Key", "</", "th", "><", "th", ">", "Value", "</", "th", "><", "/", "tr", ">\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "key_", ",_", "value_", "in_", "result_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "v_", "=_", "html", "ize_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "=_", "\"<", "tr", "><", "td", ">", "{", "0", "}", "</", "td", "><", "td", ">", "{", "1", "}", "</", "td", "><", "/", "tr", ">\"_", "._", "format_", "(_", "key_", ",_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "append_", "(_", "row_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "env_", "=_", "Environment_", "(_", "loader_", "=_", "Packa", "ge", "Loader_", "(_", "'", "gio", "tto", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "env_", "._", "get", "\\u", "template_", "(_", "'", "gener", "ic", ".", "html", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rendered_", "=_", "template_", "._", "render_", "(_", "{_", "'", "header", "'_", ":_", "h1_", ",_", "'", "table", "\\u", "header", "'_", ":_", "header_", ",_", "'", "table", "\\u", "body", "'_", ":_", "out_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "'", "body", "'_", ":_", "rendered_", ",_", "'", "mime", "type", "'_", ":_", "'", "text", "/", "html", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "View_", "(_", "Gi", "ott", "o", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "render", "s_", "(_", "'", "text", "/", "plain", "'_", ",_", "'", "text", "/", "x", "-", "cmd", "'_", ",_", "'", "text", "/", "x", "-", "irc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "gener", "ic", "\\u", "text_", "(_", "self_", ",_", "result_", ",_", "errors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kv", "\\u", "iterate_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "single", "\\u", "iterate_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "result_", ",_", "'", "items", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "is", " ", "a", " ", "dict_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kv", "\\u", "iterate_", "=_", "result_", "._", "items_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "hasattr_", "(_", "result_", ",_", "'", "lower", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "is", " ", "just", " ", "a", " ", "plain", " ", "string_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "is", " ", "a", " ", "Non", "etype_", "\\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_", "elif_", "hasattr_", "(_", "result_", ",_", "'", "append", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "is", " ", "a", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "single", "\\u", "iterate_", "=_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "hasattr_", "(_", "result_", ",_", "'", "tod", "ict", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "is", " ", "a", " ", "model", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kv", "\\u", "iterate_", "=_", "result_", "._", "tod", "ict_", "(_", ")_", "._", "items_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "gener", "ic", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kv", "\\u", "iterate_", "=_", "result_", "._", "\\u\\u", "dict\\u\\u_", "._", "items_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "kv", "\\u", "iterate_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", ",_", "value_", "in_", "kv", "\\u", "iterate_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "row_", "=_", "\"{", "0", "}", " ", "-", " ", "{", "1", "}\"_", "._", "format_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "._", "append_", "(_", "row_", ")_", "\\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 ", " _", "for_", "value_", "in_", "single", "\\u", "iterate_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "append_", "(_", "self_", "._", "gener", "ic", "\\u", "text_", "(_", "value_", ",_", "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_", "\"\\\\", "n", "\"_", "._", "join_", "(_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "jin", "ja", "\\u", "template_", "(_", "template", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pp", "x_", "=_", "get", "\\u", "config_", "(_", "'", "project", "\\u", "path", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env_", "=_", "Environment_", "(_", "loader_", "=_", "File", "System", "Loader_", "(_", "os_", "._", "path_", "._", "join_", "(_", "pp", "x_", ",_", "'", "views", "'_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "env_", "._", "get", "\\u", "template_", "(_", "template", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "jin", "ja", "\\u", "template_", "(_", "template", "\\u", "name_", ",_", "name_", "=_", "'", "data", "'_", ",_", "mimetype_", "=_", "\"", "text", "/", "html", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Meta", "-", "render", "er", " ", "for", " ", "render", "ing", " ", "jin", "ja", " ", "template", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "jin", "ja", "\\u", "renderer_", "(_", "result_", ",_", "errors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template_", "=_", "get", "\\u", "jin", "ja", "\\u", "template_", "(_", "template", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "context_", "=_", "{_", "name_", ":_", "result_", "or_", "Mock_", "(_", ")_", ",_", "'", "error", "s", "'_", ":_", "errors_", ",_", "'", "enumerate", "'_", ":_", "enumerate_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rendered_", "=_", "template_", "._", "render_", "(_", "**_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "'", "body", "'_", ":_", "rendered_", ",_", "'", "mime", "type", "'_", ":_", "mimetype_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "jin", "ja", "\\u", "renderer_", "\\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_", "partial", "\\u", "jin", "ja", "\\u", "template_", "(_", "template", "\\u", "name_", ",_", "name_", "=_", "'", "data", "'_", ",_", "mimetype_", "=_", "\"", "text", "/", "html", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Parti", "al", " ", "render", " ", "of", " ", "jin", "ja", " ", "template", "s", ".", " ", "Thi", "s", " ", "is", " ", "usef", "ul", " ", "if", " ", "you", " ", "want", " ", "to", " ", "re", "-", "render", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "template", " ", "in", " ", "the", " ", "output", " ", "middle", "ware", " ", "phase", ".", "\\", "10", ";", " ", " ", " ", " ", "The", "se", " ", "template", "s", " ", "are", " ", "render", "ed", " ", "in", " ", "a", " ", "way", " ", "tha", "t", " ", "all", " ", "undefined", " ", "variab", "les", " ", "will", " ", "be", " ", "\\", "10", ";", " ", " ", " ", " ", "kep", "t", " ", "in", " ", "the", " ", "empla", "te", " ", "inta", "ct", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "partial", "\\u", "jin", "ja", "\\u", "renderer_", "(_", "result_", ",_", "errors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template_", "=_", "get", "\\u", "jin", "ja", "\\u", "template_", "(_", "template", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old_", "=_", "template_", "._", "environment_", "._", "undefined", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "._", "environment_", "._", "undefined", "_", "=_", "Deb", "ug", "Unde", "fined", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "context_", "=_", "{_", "name_", ":_", "result_", "or_", "Mock_", "(_", ")_", ",_", "'", "error", "s", "'_", ":_", "errors_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rendered_", "=_", "template_", "._", "render_", "(_", "**_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "._", "environment_", "._", "undefined", "_", "=_", "old_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "'", "body", "'_", ":_", "rendered_", ",_", "'", "mime", "type", "'_", ":_", "mimetype_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "partial", "\\u", "jin", "ja", "\\u", "renderer_", "\\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_", "lazy", "\\u", "jin", "ja", "\\u", "template_", "(_", "template", "\\u", "name_", ",_", "name_", "=_", "'", "data", "'_", ",_", "mimetype_", "=_", "'", "text", "/", "html", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Jin", "ja", " ", "template", " ", "render", "er", " ", "tha", "t", " ", "doe", "s", " ", "not", " ", "render", " ", "the", " ", "template", " ", "at", " ", "all", ".", "\\", "10", ";", " ", " ", " ", " ", "Ins", "tea", "d", " ", "of", " ", "return", "s", " ", "the", " ", "context", " ", "and", " ", "template", " ", "object", " ", "blend", "ed", " ", "tog", "ether", ".", "\\", "10", ";", " ", " ", " ", " ", "Make", " ", "sure", " ", "to", " ", "add", " ", "``", "gio", "tto", ".", "middle", "ware", ".", "Render", "La", "zy", "template", "``", " ", "to", " ", "the", " ", "output", "\\", "10", ";", " ", " ", " ", " ", "middle", "ware", " ", "stre", "ad", " ", "of", " ", "any", " ", "program", " ", "tha", "t", " ", "use", "s", " ", "this", " ", "render", "er", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "lazy", "\\u", "jin", "ja", "\\u", "renderer_", "(_", "result_", ",_", "errors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "template_", "=_", "get", "\\u", "jin", "ja", "\\u", "template_", "(_", "template", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "context_", "=_", "{_", "name_", ":_", "result_", "or_", "Mock_", "(_", ")_", ",_", "'", "error", "s", "'_", ":_", "errors_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "(_", "'", "jin", "ja", "2", "'_", ",_", "template_", ",_", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "{_", "'", "body", "'_", ":_", "data_", ",_", "'", "mime", "type", "'_", ":_", "mimetype_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "lazy", "\\u", "jin", "ja", "\\u", "renderer_", "\\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_", "Image", "Viewer_", "(_", "Gi", "ott", "o", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "For", " ", "viewin", "g", " ", "images", ".", " ", "The", " ", "'", "result", "'", " ", "must", " ", "be", " ", "a", " ", "file", " ", "object", " ", "tha", "t", " ", "contain", "s", " ", "image", "\\", "10", ";", " ", " ", " ", " ", "data", " ", "(", "doe", "sn", "'", "t", " ", "matte", "r", " ", "the", " ", "format", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Image", "Viewer_", "(_", "Gi", "ott", "o", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "render", "s_", "(_", "'", "text", "/", "plain", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "plaintext_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Convert", "s", " ", "the", " ", "image", " ", "object", " ", "int", "o", " ", "an", " ", "ascii", " ", "represent", "ation", ".", " ", "Code", " ", "take", "n", " ", "from", "\\", "10", ";", " ", " ", " ", " ", "http", "://", "a", "-", "eter", ".", "blogs", "pot", ".", "com", "/", "2010", "/", "04", "/", "image", "-", "to", "-", "ascii", "-", "art", "-", "in", "-", "python", ".", "html", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "PIL_", "import_", "Image_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ascii", "\\u", "chars_", "=_", "[_", "'#'_", ",_", "'", "A", "'_", ",_", "'@'_", ",_", "'%'_", ",_", "'", "S", "'_", ",_", "'+'_", ",_", "'<'_", ",_", "'*'_", ",_", "':'_", ",_", "','_", ",_", "'.'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "image", "\\u", "to", "\\u", "ascii_", "(_", "image_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "image", "\\u", "as", "\\u", "ascii_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "pixels_", "=_", "list_", "(_", "image_", "._", "getdata_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pixel", "\\u", "value_", "in_", "all", "\\u", "pixels_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "index_", "=_", "pixel", "\\u", "value_", "/_", "25_", "#", " ", "0", " ", "-", " ", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image", "\\u", "as", "\\u", "ascii_", "._", "append_", "(_", "ascii", "\\u", "chars_", "[_", "index_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "image", "\\u", "as", "\\u", "ascii_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "img_", "=_", "Image_", "._", "open_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "width_", ",_", "hei", "gth", "_", "=_", "img_", "._", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "width_", "=_", "80_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "hei", "gth", "_", "=_", "int_", "(_", "(_", "hei", "gth", "_", "*_", "new", "\\u", "width_", ")_", "/_", "width_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image_", "=_", "img_", "._", "resize_", "(_", "(_", "new", "\\u", "width_", ",_", "new", "\\u", "hei", "gth", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "image_", "=_", "new", "\\u", "image_", "._", "convert_", "(_", "\"", "L", "\"_", ")_", "#", " ", "convert", " ", "to", " ", "grayscale", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "now", " ", "tha", "t", " ", "we", " ", "have", " ", "a", " ", "grayscale", " ", "image", " ", "with", " ", "some", " ", "fixed", " ", "widt", "h", " ", "we", " ", "have", " ", "to", " ", "convert", " ", "every", " ", "pixel_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "the", " ", "appropr", "iate", " ", "ascii", " ", "character", " ", "from", " ", "\"", "ascii", "\\u", "char", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "img", "\\u", "as", "\\u", "ascii_", "=_", "image", "\\u", "to", "\\u", "ascii_", "(_", "new", "\\u", "image_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img", "\\u", "as", "\\u", "ascii_", "=_", "''_", "._", "join_", "(_", "ch_", "for_", "ch_", "in_", "img", "\\u", "as", "\\u", "ascii_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "range_", "(_", "0_", ",_", "len_", "(_", "img", "\\u", "as", "\\u", "ascii_", ")_", ",_", "new", "\\u", "width_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "out_", "._", "append_", "(_", "img", "\\u", "as", "\\u", "ascii_", "[_", "c_", ":_", "c_", "+_", "new", "\\u", "width_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\"\\\\", "n", "\"_", "._", "join_", "(_", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Image", "Viewer_", "(_", "Gi", "ott", "o", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "image_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Image", "Viewer_", "(_", "Gi", "ott", "o", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "image", "\\u", "jpeg", "_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "image_", "(_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Image", "Viewer_", "(_", "Gi", "ott", "o", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "text", "\\u", "cmd_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "result_", "._", "read_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Image", "Viewer_", "(_", "Gi", "ott", "o", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "text", "\\u", "html_", "(_", "self_", ",_", "result_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"\"\"", "<!", "DOC", "TYPE", " ", "html", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "html", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "body", ">", "\\", "10", ";", " ", " ", " ", " ", "<", "img", " ", "src", "=\"", "/", "multipl", "y", "?", "x", "=", "4", "&", "y", "=", "7", "\">", "\\", "10", ";", " ", " ", " ", " ", "</", "body", ">", "\\", "10", ";", " ", " ", " ", " ", "</", "html", ">\"\"\"_", "\\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_", "URL", "Followe", "r_", "(_", "Basic", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "For", " ", "visuali", "zin", "g", " ", "program", "s", " ", "tha", "t", " ", "return", " ", "a", " ", "url", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "URL", "Followe", "r_", "(_", "Basic", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "render", "s_", "(_", "\"", "text", "/", "html", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "text", "\\u", "html_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Redirect", "ion_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "URL", "Followe", "r_", "(_", "Basic", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "cmd_", "(_", "self_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "execute", " ", "browse", "r", " ", "and", " ", "give", " ", "it", " ", "the", " ", "url_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Force", "JSO", "NV", "iew_", "(_", "Gi", "ott", "o", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "All", " ", "object", "s", " ", "goi", "ng", " ", "through", " ", "this", " ", "View", " ", "will", " ", "be", " ", "displaye", "d", " ", "as", " ", "JSO", "N", " ", "no", " ", "matte", "r", " ", "what", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Force", "JSO", "NV", "iew_", "(_", "Gi", "ott", "o", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "@_", "render", "s_", "(_", "\"*", "/*\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "renderer_", "(_", "self_", ",_", "data_", ",_", "errors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "jsonify_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Force", "Text", "View_", "(_", "Gi", "ott", "o", "View_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Force", "Text", "View_", "(_", "Gi", "ott", "o", "View_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "@_", "render", "s_", "(_", "\"*", "/*\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "renderer_", "(_", "self_", ",_", "data_", ",_", "errors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "gener", "ic", "\\u", "text_", "(_", "data_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 0, 1, 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, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2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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, 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, 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, 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, 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 ]
Unused import
adieu/allbuttonspressed/docutils/parsers/rst/directives/images.py
[ { "content": "# $Id: images.py 7062 2011-06-30 22:14:29Z milde $\n# Author: David Goodger <goodger@python.org>\n# Copyright: This module has been placed in the public domain.\n\n\"\"\"\nDirectives for figures and simple images.\n\"\"\"\n\n__docformat__ = 'reStructuredText'\n\n\nimport sys\nfrom docutils import nodes, utils\nfrom docutils.parsers.rst import Directive\nfrom docutils.parsers.rst import directives, states\nfrom docutils.nodes import fully_normalize_name, whitespace_normalize_name\nfrom docutils.parsers.rst.roles import set_classes\n\ntry:\n import Image as PIL # PIL\nexcept ImportError:\n PIL = None\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Image(Directive):\n\n align_h_values = ('left', 'center', 'right')\n align_v_values = ('top', 'middle', 'bottom')\n align_values = align_v_values + align_h_values\n\n\n required_arguments = 1\n optional_arguments = 0\n final_argument_whitespace = True\n option_spec = {'alt': directives.unchanged,\n 'height': directives.length_or_unitless,\n 'width': directives.length_or_percentage_or_unitless,\n 'scale': directives.percentage,\n 'align': align,\n 'name': directives.unchanged,\n 'target': directives.unchanged_required,\n 'class': directives.class_option}\n", "metadata": "root.Image", "header": "['module', '___EOS___']", "index": 24 }, { "content": " def align(argument):\n # This is not callable as self.align. We cannot make it a\n # staticmethod because we're saving an unbound method in\n # option_spec below.\n return directives.choice(argument, Image.align_values)", "metadata": "root.Image.align", "header": "['class', 'Image', '(', 'Directive', ')', ':', '___EOS___']", "index": 30 }, { "content": " def run(self):\n if 'align' in self.options:\n if isinstance(self.state, states.SubstitutionDef):\n # Check for align_v_values.\n if self.options['align'] not in self.align_v_values:\n raise self.error(\n 'Error in \"%s\" directive: \"%s\" is not a valid value '\n 'for the \"align\" option within a substitution '\n 'definition. Valid values for \"align\" are: \"%s\".'\n % (self.name, self.options['align'],\n '\", \"'.join(self.align_v_values)))\n elif self.options['align'] not in self.align_h_values:\n raise self.error(\n 'Error in \"%s\" directive: \"%s\" is not a valid value for '\n 'the \"align\" option. Valid values for \"align\" are: \"%s\".'\n % (self.name, self.options['align'],\n '\", \"'.join(self.align_h_values)))\n messages = []\n reference = directives.uri(self.arguments[0])\n self.options['uri'] = reference\n reference_node = None\n if 'target' in self.options:\n block = states.escape2null(\n self.options['target']).splitlines()\n block = [line for line in block]\n target_type, data = self.state.parse_target(\n block, self.block_text, self.lineno)\n if target_type == 'refuri':\n reference_node = nodes.reference(refuri=data)\n elif target_type == 'refname':\n reference_node = nodes.reference(\n refname=fully_normalize_name(data),\n name=whitespace_normalize_name(data))\n reference_node.indirect_reference_name = data\n self.state.document.note_refname(reference_node)\n else: # malformed target\n messages.append(data) # data is a system message\n del self.options['target']\n set_classes(self.options)\n image_node = nodes.image(self.block_text, **self.options)\n self.add_name(image_node)\n if reference_node:\n reference_node += image_node\n return messages + [reference_node]\n else:\n return messages + [image_node]", "metadata": "root.Image.run", "header": "['class', 'Image', '(', 'Directive', ')', ':', '___EOS___']", "index": 48 }, { "content": "class Figure(Image):\n\n\n\n option_spec = Image.option_spec.copy()\n option_spec['figwidth'] = figwidth_value\n option_spec['figclass'] = directives.class_option\n option_spec['align'] = align\n has_content = True\n", "metadata": "root.Figure", "header": "['module', '___EOS___']", "index": 96 }, { "content": " def align(argument):\n return directives.choice(argument, Figure.align_h_values)", "metadata": "root.Figure.align", "header": "['class', 'Figure', '(', 'Image', ')', ':', '___EOS___']", "index": 98 }, { "content": " def figwidth_value(argument):\n if argument.lower() == 'image':\n return 'image'\n else:\n return directives.length_or_percentage_or_unitless(argument, 'px')", "metadata": "root.Figure.figwidth_value", "header": "['class', 'Figure', '(', 'Image', ')', ':', '___EOS___']", "index": 101 }, { "content": " def run(self):\n figwidth = self.options.pop('figwidth', None)\n figclasses = self.options.pop('figclass', None)\n align = self.options.pop('align', None)\n (image_node,) = Image.run(self)\n if isinstance(image_node, nodes.system_message):\n return [image_node]\n figure_node = nodes.figure('', image_node)\n if figwidth == 'image':\n if PIL and self.state.document.settings.file_insertion_enabled:\n # PIL doesn't like Unicode paths:\n try:\n i = PIL.open(str(image_node['uri']))\n except (IOError, UnicodeError):\n pass\n else:\n self.state.document.settings.record_dependencies.add(\n image_node['uri'])\n figure_node['width'] = i.size[0]\n elif figwidth is not None:\n figure_node['width'] = figwidth\n if figclasses:\n figure_node['classes'] += figclasses\n if align:\n figure_node['align'] = align\n if self.content:\n node = nodes.Element() # anonymous container for parsing\n self.state.nested_parse(self.content, self.content_offset, node)\n first_node = node[0]\n if isinstance(first_node, nodes.paragraph):\n caption = nodes.caption(first_node.rawsource, '',\n *first_node.children)\n figure_node += caption\n elif not (isinstance(first_node, nodes.comment)\n and len(first_node) == 0):\n error = self.state_machine.reporter.error(\n 'Figure caption must be a paragraph or empty comment.',\n nodes.literal_block(self.block_text, self.block_text),\n line=self.lineno)\n return [figure_node, error]\n if len(node) > 1:\n figure_node += nodes.legend('', *node[1:])\n return [figure_node]", "metadata": "root.Figure.run", "header": "['class', 'Figure', '(', 'Image', ')', ':', '___EOS___']", "index": 113 } ]
[ { "span": "import sys", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 10 }, { "span": "from docutils import nodes, utils", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 33 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "$", "Id", ":", " ", "images", ".", "py", " ", "706", "2", " ", "2011", "-0", "6", "-", "30", " ", "2", "2", ":", "14", ":", "2", "9", "Z", " ", "mil", "de", " ", "$", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Author", ":", " ", "Dav", "id", " ", "Good", "ger", " ", "<", "good", "ger", "@", "python", ".", "org", ">_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", ":", " ", "Thi", "s", " ", "module", " ", "has", " ", "bee", "n", " ", "place", "d", " ", "in", " ", "the", " ", "public", " ", "domain", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Directive", "s", " ", "for", " ", "figure", "s", " ", "and", " ", "simple", " ", "images", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "docformat", "\\u\\u_", "=_", "'", "re", "Structur", "ed", "Text", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "docutils_", "import_", "nodes_", ",_", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "docutils_", "._", "parsers_", "._", "rst_", "import_", "Directive", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "docutils_", "._", "parsers_", "._", "rst_", "import_", "directives_", ",_", "states_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "docutils_", "._", "nodes_", "import_", "full", "y", "\\u", "normali", "ze", "\\u", "name_", ",_", "whitespace", "\\u", "normali", "ze", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "docutils_", "._", "parsers_", "._", "rst_", "._", "roles_", "import_", "set\\u", "classes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "Image_", "as_", "PIL_", "#", " ", "PIL_", "\\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 ", " _", "PIL_", "=_", "None_", "\\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_", "Image_", "(_", "Directive", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "align", "\\u", "h", "\\u", "values_", "=_", "(_", "'", "left", "'_", ",_", "'", "center", "'_", ",_", "'", "right", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "align", "\\u", "v", "\\u", "values_", "=_", "(_", "'", "top", "'_", ",_", "'", "middle", "'_", ",_", "'", "bottom", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "align", "\\u", "values_", "=_", "align", "\\u", "v", "\\u", "values_", "+_", "align", "\\u", "h", "\\u", "values_", "\\u\\u\\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_", "require", "d\\u", "arguments_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "option", "al", "\\u", "arguments_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "final", "\\u", "argu", "ment", "\\u", "whitespace_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "option", "\\u", "spec_", "=_", "{_", "'", "alt", "'_", ":_", "directives_", "._", "unchanged", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "height", "'_", ":_", "directives_", "._", "length", "\\u", "or", "\\u", "unit", "less_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "widt", "h", "'_", ":_", "directives_", "._", "length", "\\u", "or", "\\u", "percentage", "\\u", "or", "\\u", "unit", "less_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "scale", "'_", ":_", "directives_", "._", "percentage_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "align", "'_", ":_", "align_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "directives_", "._", "unchanged", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "target", "'_", ":_", "directives_", "._", "unchanged", "\\u", "required_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "class", "'_", ":_", "directives_", "._", "class", "\\u", "option_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Image_", "(_", "Directive", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "align_", "(_", "argument_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "not", " ", "calla", "ble", " ", "as", " ", "self", ".", "align", ".", " ", " ", "We", " ", "cann", "ot", " ", "make", " ", "it", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "static", "method", " ", "bec", "aus", "e", " ", "we", "'", "re", " ", "saving", " ", "an", " ", "unbound", " ", "method", " ", "in_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "option", "\\u", "spec", " ", "belo", "w", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "directives_", "._", "choice_", "(_", "argument_", ",_", "Image_", "._", "align", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Image_", "(_", "Directive", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "'", "align", "'_", "in_", "self_", "._", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "self_", "._", "state_", ",_", "states_", "._", "Substituti", "on", "Def_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Check", " ", "for", " ", "align", "\\u", "v", "\\u", "values", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "options_", "[_", "'", "align", "'_", "]_", "not_", "in_", "self_", "._", "align", "\\u", "v", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "raise_", "self_", "._", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Error", " ", "in", " ", "\"%", "s", "\"", " ", "directive", ":", " ", "\"%", "s", "\"", " ", "is", " ", "not", " ", "a", " ", "valid", " ", "value", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "for", " ", "the", " ", "\"", "align", "\"", " ", "option", " ", "within", " ", "a", " ", "substitution", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "definit", "ion", ".", " ", " ", "Valid", " ", "values", " ", "for", " ", "\"", "align", "\"", " ", "are", ":", " ", "\"%", "s", "\".'_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "(_", "self_", "._", "name_", ",_", "self_", "._", "options_", "[_", "'", "align", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\",", " ", "\"'_", "._", "join_", "(_", "self_", "._", "align", "\\u", "v", "\\u", "values_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "options_", "[_", "'", "align", "'_", "]_", "not_", "in_", "self_", "._", "align", "\\u", "h", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "self_", "._", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Error", " ", "in", " ", "\"%", "s", "\"", " ", "directive", ":", " ", "\"%", "s", "\"", " ", "is", " ", "not", " ", "a", " ", "valid", " ", "value", " ", "for", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "the", " ", "\"", "align", "\"", " ", "option", ".", " ", " ", "Valid", " ", "values", " ", "for", " ", "\"", "align", "\"", " ", "are", ":", " ", "\"%", "s", "\".'_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "(_", "self_", "._", "name_", ",_", "self_", "._", "options_", "[_", "'", "align", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\",", " ", "\"'_", "._", "join_", "(_", "self_", "._", "align", "\\u", "h", "\\u", "values_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "messages_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reference_", "=_", "directives_", "._", "uri_", "(_", "self_", "._", "arguments_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "options_", "[_", "'", "uri", "'_", "]_", "=_", "reference_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reference", "\\u", "node_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "target", "'_", "in_", "self_", "._", "options_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "block_", "=_", "states_", "._", "escape", "2n", "ull", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "options_", "[_", "'", "target", "'_", "]_", ")_", "._", "splitlines_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "block_", "=_", "[_", "line_", "for_", "line_", "in_", "block_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "target", "\\u", "type_", ",_", "data_", "=_", "self_", "._", "state_", "._", "parse", "\\u", "target_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "block_", ",_", "self_", "._", "block", "\\u", "text_", ",_", "self_", "._", "lineno_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "target", "\\u", "type_", "==_", "'", "ref", "uri", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reference", "\\u", "node_", "=_", "nodes_", "._", "reference_", "(_", "ref", "uri_", "=_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "target", "\\u", "type_", "==_", "'", "refn", "ame", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reference", "\\u", "node_", "=_", "nodes_", "._", "reference_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "refn", "ame_", "=_", "full", "y", "\\u", "normali", "ze", "\\u", "name_", "(_", "data_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "whitespace", "\\u", "normali", "ze", "\\u", "name_", "(_", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reference", "\\u", "node_", "._", "indirect", "\\u", "reference", "\\u", "name_", "=_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "document_", "._", "note", "\\u", "refn", "ame_", "(_", "reference", "\\u", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "#", " ", "mal", "formed", " ", "target_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "messages_", "._", "append_", "(_", "data_", ")_", "#", " ", "data", " ", "is", " ", "a", " ", "system", " ", "message_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "del_", "self_", "._", "options_", "[_", "'", "target", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "set\\u", "classes_", "(_", "self_", "._", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image", "\\u", "node_", "=_", "nodes_", "._", "image_", "(_", "self_", "._", "block", "\\u", "text_", ",_", "**_", "self_", "._", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "name_", "(_", "image", "\\u", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "reference", "\\u", "node_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reference", "\\u", "node_", "+=_", "image", "\\u", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "messages_", "+_", "[_", "reference", "\\u", "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 ", " _", "return_", "messages_", "+_", "[_", "image", "\\u", "node_", "]_", "\\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_", "Figure_", "(_", "Image_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "option", "\\u", "spec_", "=_", "Image_", "._", "option", "\\u", "spec_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "option", "\\u", "spec_", "[_", "'", "fig", "widt", "h", "'_", "]_", "=_", "fig", "widt", "h", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "option", "\\u", "spec_", "[_", "'", "fig", "class", "'_", "]_", "=_", "directives_", "._", "class", "\\u", "option_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "option", "\\u", "spec_", "[_", "'", "align", "'_", "]_", "=_", "align_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "has", "\\u", "content_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Figure_", "(_", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "align_", "(_", "argument_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "directives_", "._", "choice_", "(_", "argument_", ",_", "Figure_", "._", "align", "\\u", "h", "\\u", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Figure_", "(_", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "fig", "widt", "h", "\\u", "value_", "(_", "argument_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "argument_", "._", "lower_", "(_", ")_", "==_", "'", "image", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", "image", "'_", "\\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_", "directives_", "._", "length", "\\u", "or", "\\u", "percentage", "\\u", "or", "\\u", "unit", "less_", "(_", "argument_", ",_", "'", "px", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Figure_", "(_", "Image_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "run_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fig", "width_", "=_", "self_", "._", "options_", "._", "pop_", "(_", "'", "fig", "widt", "h", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fig", "classes_", "=_", "self_", "._", "options_", "._", "pop_", "(_", "'", "fig", "class", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "align_", "=_", "self_", "._", "options_", "._", "pop_", "(_", "'", "align", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "image", "\\u", "node_", ",_", ")_", "=_", "Image_", "._", "run_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "image", "\\u", "node_", ",_", "nodes_", "._", "system", "\\u", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "image", "\\u", "node_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "figure", "\\u", "node_", "=_", "nodes_", "._", "figure_", "(_", "''_", ",_", "image", "\\u", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fig", "width_", "==_", "'", "image", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "PIL_", "and_", "self_", "._", "state_", "._", "document_", "._", "settings_", "._", "file", "\\u", "insertion", "\\u", "enabled_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "PI", "L", " ", "doe", "sn", "'", "t", " ", "like", " ", "Unic", "ode", " ", "path", "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 ", " ", "_", "i_", "=_", "PIL_", "._", "open_", "(_", "str_", "(_", "image", "\\u", "node_", "[_", "'", "uri", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "IO", "Error_", ",_", "Unic", "ode", "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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "state_", "._", "document_", "._", "settings_", "._", "record", "\\u", "dependencies_", "._", "add_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "image", "\\u", "node_", "[_", "'", "uri", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "figure", "\\u", "node_", "[_", "'", "widt", "h", "'_", "]_", "=_", "i_", "._", "size_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "fig", "width_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "figure", "\\u", "node_", "[_", "'", "widt", "h", "'_", "]_", "=_", "fig", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "fig", "classes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "figure", "\\u", "node_", "[_", "'", "classe", "s", "'_", "]_", "+=_", "fig", "classes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "align_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "figure", "\\u", "node_", "[_", "'", "align", "'_", "]_", "=_", "align_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "content_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "node_", "=_", "nodes_", "._", "Element_", "(_", ")_", "#", " ", "anonym", "ous", " ", "container", " ", "for", " ", "parsing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "state_", "._", "nest", "ed", "\\u", "parse_", "(_", "self_", "._", "content_", ",_", "self_", "._", "content", "\\u", "offset_", ",_", "node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "first", "\\u", "node_", "=_", "node_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "first", "\\u", "node_", ",_", "nodes_", "._", "paragraph_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "caption_", "=_", "nodes_", "._", "caption_", "(_", "first", "\\u", "node_", "._", "raws", "ource_", ",_", "''_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "*_", "first", "\\u", "node_", "._", "children_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "figure", "\\u", "node_", "+=_", "caption_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "(_", "isinstance_", "(_", "first", "\\u", "node_", ",_", "nodes_", "._", "comment_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "len_", "(_", "first", "\\u", "node_", ")_", "==_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "error_", "=_", "self_", "._", "state", "\\u", "machine_", "._", "reporter_", "._", "error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Fig", "ure", " ", "caption", " ", "must", " ", "be", " ", "a", " ", "paragraph", " ", "or", " ", "empty", " ", "comment", ".'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nodes_", "._", "literal", "\\u", "block_", "(_", "self_", "._", "block", "\\u", "text_", ",_", "self_", "._", "block", "\\u", "text_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "line_", "=_", "self_", "._", "lineno_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "figure", "\\u", "node_", ",_", "error_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "node_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "figure", "\\u", "node_", "+=_", "nodes_", "._", "legend_", "(_", "''_", ",_", "*_", "node_", "[_", "1_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "figure", "\\u", "node_", "]_" ]
[ 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,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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 ]
Unused local variable
glue-viz/glue/glue/core/qt/tests/test_style_dialog.py
[ { "content": "def test_style_dialog():\n\n # This is in part a regression test for a bug in Python 3. It is not a\n # full test of StyleDialog.\n\n session = simple_session()\n hub = session.hub\n collect = session.data_collection\n\n image = Data(label='im',\n x=[[1, 2], [3, 4]],\n y=[[2, 3], [4, 5]])\n\n pos = QtCore.QPoint(10, 10)\n st = NonBlockingStyleDialog.dropdown_editor(image, pos)", "metadata": "root.test_style_dialog", "header": "['module', '___EOS___']", "index": 18 } ]
[ { "span": "hub ", "start_line": 24, "start_column": 4, "end_line": 24, "end_column": 7 }, { "span": "collect ", "start_line": 25, "start_column": 4, "end_line": 25, "end_column": 11 }, { "span": "st ", "start_line": 32, "start_column": 4, "end_line": 32, "end_column": 6 } ]
[]
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_", "test\\u", "style", "\\u", "dialog_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "in", " ", "part", " ", "a", " ", "regress", "ion", " ", "test", " ", "for", " ", "a", " ", "bug", " ", "in", " ", "Pyth", "on", " ", "3", ".", " ", "It", " ", "is", " ", "not", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "full", " ", "test", " ", "of", " ", "Style", "Dialog", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "session_", "=_", "simple", "\\u", "session_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hub_", "=_", "session_", "._", "hub_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "collect_", "=_", "session_", "._", "data\\u", "collection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "image_", "=_", "Data_", "(_", "label_", "=_", "'", "im", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "x_", "=_", "[_", "[_", "1_", ",_", "2_", "]_", ",_", "[_", "3_", ",_", "4_", "]_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "y_", "=_", "[_", "[_", "2_", ",_", "3_", "]_", ",_", "[_", "4_", ",_", "5_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pos_", "=_", "Qt", "Core_", "._", "QP", "oint_", "(_", "10_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "st_", "=_", "Non", "Block", "ing", "Style", "Dialog_", "._", "dropdown", "\\u", "editor_", "(_", "image_", ",_", "pos_", ")_" ]
[ 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, 0, 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, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
`__eq__` not overridden when adding attributes
willhardy/django-seo/rollyourown/seo/utils.py
[ { "content": "class LazyList(list):\n \"\"\" Generic python list which is populated when items are first accessed.\n \"\"\"\n\n\n # Ensure list is only populated once\n\n # Accessing methods that require a populated field", "metadata": "root.LazyList", "header": "['module', '___EOS___']", "index": 25 }, { "content": " def populate(self):\n \"\"\" Populates the list.\n This method must be overridden by subclasses.\n It is called once, when items in the list are first accessed.\n \"\"\"\n raise NotImplementedError", "metadata": "root.LazyList.populate", "header": "['class', 'LazyList', '(', 'list', ')', ':', '___EOS___']", "index": 29 }, { "content": " def __init__(self, populate_function=None):\n if populate_function is not None:\n # TODO: Test this functionality!\n self.populate = populate_function\n self._populated = False", "metadata": "root.LazyList.__init__", "header": "['class', 'LazyList', '(', 'list', ')', ':', '___EOS___']", "index": 37 }, { "content": " def _populate(self):\n \"\"\" Populate this list by calling populate(), but only once. \"\"\"\n if not self._populated:\n logging.debug(\"Populating lazy list %d (%s)\" % (id(self), self.__class__.__name__))\n try:\n self.populate()\n self._populated = True\n except Exception, e:\n logging.debug(\"Currently unable to populate lazy list: %s\" % e)", "metadata": "root.LazyList._populate", "header": "['class', 'LazyList', '(', 'list', ')', ':', '___EOS___']", "index": 42 }, { "content": " def __len__(self):\n self._populate()\n return super(LazyList, self).__len__()", "metadata": "root.LazyList.__len__", "header": "['class', 'LazyList', '(', 'list', ')', ':', '___EOS___']", "index": 53 }, { "content": " def __getitem__(self, key):\n self._populate()\n return super(LazyList, self).__getitem__(key)", "metadata": "root.LazyList.__getitem__", "header": "['class', 'LazyList', '(', 'list', ')', ':', '___EOS___']", "index": 56 }, { "content": " def __setitem__(self, key, value):\n self._populate()\n return super(LazyList, self).__setitem__(key, value)", "metadata": "root.LazyList.__setitem__", "header": "['class', 'LazyList', '(', 'list', ')', ':', '___EOS___']", "index": 59 }, { "content": " def __delitem__(self, key):\n self._populate()\n return super(LazyList, self).__delitem__(key)", "metadata": "root.LazyList.__delitem__", "header": "['class', 'LazyList', '(', 'list', ')', ':', '___EOS___']", "index": 62 }, { "content": " def __iter__(self):\n self._populate()\n return super(LazyList, self).__iter__()", "metadata": "root.LazyList.__iter__", "header": "['class', 'LazyList', '(', 'list', ')', ':', '___EOS___']", "index": 65 }, { "content": " def __contains__(self, item):\n self._populate()\n return super(LazyList, self).__contains__(item)", "metadata": "root.LazyList.__contains__", "header": "['class', 'LazyList', '(', 'list', ')', ':', '___EOS___']", "index": 68 } ]
[ { "span": "class LazyList(list):", "start_line": 25, "start_column": 0, "end_line": 25, "end_column": 21 } ]
[ { "span": "self.populate ", "start_line": 40, "start_column": 12, "end_line": 40, "end_column": 25 }, { "span": "self._populated ", "start_line": 41, "start_column": 8, "end_line": 41, "end_column": 23 }, { "span": "self._populated ", "start_line": 48, "start_column": 16, "end_line": 48, "end_column": 31 } ]
1
false
[ "[CLS]_", "`_", "\\u\\u", "eq\\u\\u_", "`_", "not_", "overrid", "den_", "when_", "addin", "g_", "attributes_", "[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_", "La", "zy", "List_", "(_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Gene", "ric", " ", "python", " ", "list", " ", "whi", "ch", " ", "is", " ", "populate", "d", " ", "whe", "n", " ", "items", " ", "are", " ", "first", " ", "accesse", "d", ".", "\\", "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_", "#", " ", "Ensur", "e", " ", "list", " ", "is", " ", "only", " ", "populate", "d", " ", "once_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Access", "ing", " ", "method", "s", " ", "tha", "t", " ", "require", " ", "a", " ", "populate", "d", " ", "field_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "List_", "(_", "list_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "populate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Populate", "s", " ", "the", " ", "list", ".", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "method", " ", "must", " ", "be", " ", "overrid", "den", " ", "by", " ", "subclasses", ".", "\\", "10", ";", " ", " ", " ", " ", "It", " ", "is", " ", "call", "ed", " ", "onc", "e", ",", " ", "whe", "n", " ", "items", " ", "in", " ", "the", " ", "list", " ", "are", " ", "first", " ", "accesse", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Not", "Impl", "ement", "ed", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "List_", "(_", "list_", ")_", ":_", "\\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_", ",_", "populate", "\\u", "function_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "populate", "\\u", "function_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Test", " ", "this", " ", "functional", "it", "y", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "populate_", "=_", "populate", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "populate", "d_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "List_", "(_", "list_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "populate_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Populate", " ", "this", " ", "list", " ", "by", " ", "calling", " ", "populate", "()", ",", " ", "but", " ", "only", " ", "onc", "e", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "\\u", "populate", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "\"", "Popula", "ting", " ", "lazy", " ", "list", " ", "%", "d", " ", "(%", "s", ")\"_", "%_", "(_", "id_", "(_", "self_", ")_", ",_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "populate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "populate", "d_", "=_", "True_", "\\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 ", " _", "logging_", "._", "debug_", "(_", "\"", "Curr", "ent", "ly", " ", "una", "ble", " ", "to", " ", "populate", " ", "lazy", " ", "list", ":", " ", "%", "s", "\"_", "%_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "List_", "(_", "list_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "len\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "populate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "La", "zy", "List_", ",_", "self_", ")_", "._", "\\u\\u", "len\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "List_", "(_", "list_", ")_", ":_", "\\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 ", " _", "self_", "._", "\\u", "populate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "La", "zy", "List_", ",_", "self_", ")_", "._", "\\u\\u", "getitem\\u\\u_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "List_", "(_", "list_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "setitem\\u\\u_", "(_", "self_", ",_", "key_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "populate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "La", "zy", "List_", ",_", "self_", ")_", "._", "\\u\\u", "setitem\\u\\u_", "(_", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "List_", "(_", "list_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "delitem\\u\\u_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "populate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "La", "zy", "List_", ",_", "self_", ")_", "._", "\\u\\u", "delitem\\u\\u_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "List_", "(_", "list_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "iter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "populate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "La", "zy", "List_", ",_", "self_", ")_", "._", "\\u\\u", "iter\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "La", "zy", "List_", "(_", "list_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "contains\\u\\u_", "(_", "self_", ",_", "item_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "populate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "super_", "(_", "La", "zy", "List_", ",_", "self_", ")_", "._", "\\u\\u", "contains\\u\\u_", "(_", "item_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 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, 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, 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 ]
Unused import
sakura-internet/saklient.python/saklient/errors/httpexception.py
[ { "content": "# -*- coding:utf-8 -*-\n\n# This code is automatically transpiled by Saklient Translator\n\nimport six\nimport saklient\n\nstr = six.text_type\n# module saklient.errors.httpexception\n\n \n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class HttpException(Exception):\n \n # (instance field) status\n \n # (instance field) code\n \n ## @param {int} status\n # @param {str} code=None\n # @param {str} message=\"\"", "metadata": "root.HttpException", "header": "['module', '___EOS___']", "index": 10 }, { "content": " def __init__(self, status, code=None, message=\"\"):\n super(HttpException, self).__init__(message)\n self.status = status\n self.code = code", "metadata": "root.HttpException.__init__", "header": "['class', 'HttpException', '(', 'Exception', ')', ':', '___NEWLINE___', '___NL___', '# (instance field) status', '___NL___', '___NL___', '# (instance field) code', '___NL___', '___NL___', '## @param {int} status', '___NL___', '# @param {str} code=None', '___NL___', '# @param {str} message=\"\"', '___NL___', '___EOS___']", "index": 19 } ]
[ { "span": "import saklient", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 15 } ]
[]
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_", "#", " ", "Thi", "s", " ", "code", " ", "is", " ", "automati", "call", "y", " ", "transp", "ile", "d", " ", "by", " ", "Sa", "kli", "ent", " ", "Translator_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "six_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sak", "lient_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "=_", "six_", "._", "text", "\\u", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "module", " ", "sak", "lien", "t", ".", "error", "s", ".", "http", "exception_", "\\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_", "Http", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "instance", " ", "field", ")", " ", "status_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "instance", " ", "field", ")", " ", "code_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "@", "param", " ", "{", "int", "}", " ", "status_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "@", "param", " ", "{", "str", "}", " ", "code", "=", "None_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "@", "param", " ", "{", "str", "}", " ", "message", "=\"\"", "_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Http", "Exception_", "(_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "instance", " ", "field", ")", " ", "status_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "instance", " ", "field", ")", " ", "code_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "@", "param", " ", "{", "int", "}", " ", "status_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "@", "param", " ", "{", "str", "}", " ", "code", "=", "None_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "@", "param", " ", "{", "str", "}", " ", "message", "=\"\"", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", ",_", "status_", ",_", "code_", "=_", "None_", ",_", "message_", "=_", "\"\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Http", "Exception_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "status_", "=_", "status_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "code_", "=_", "code_" ]
[ 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, 2, 2, 2, 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, 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 ]
Except block handles 'BaseException'
coronalabs/CoronaSDK-SublimeText/debugger.py
[ { "content": "#\n# Sublime Text plugin to support Corona Editor\n#\n# Copyright (c) 2013 Corona Labs Inc. A mobile development software company. All rights reserved.\n#\n# MIT License - see https://raw.github.com/coronalabs/CoronaSDK-SublimeText/master/LICENSE\n\nimport sublime\nimport sublime_plugin\nimport os\nimport re\nimport threading\nimport subprocess\nimport datetime\nimport sys\nimport socket\nimport traceback\n\ntry:\n import queue # P3\n coronaQueue = queue\nexcept:\n import Queue # P2\n coronaQueue = Queue\n\nconsoleOutputQ = None\nvariablesOutputQ = None\nluaStackOutputQ = None\ndebuggerCmdQ = None\n\ntry:\n from . import _corona_utils # P3\nexcept:\n import _corona_utils # P2\n\n\n# determine if 'obj' is a string in both Python 2.x and 3.x\n\n\nstatusRegion = None\n\n# We change our behavior to avoid complications with certain CoronaSDK releases\ncorona_sdk_version = None\n# Getting settings in certain threads locks up Sublime Text so do it just once\ncorona_sdk_debug = _corona_utils.GetSetting(\"corona_sdk_debug\", False)\n\ndebugFP = None\n\n\n\n\nHOST = '' # Symbolic name meaning all available interfaces\nPORT = 8171 # Arbitrary non-privileged port, matches Simulator\n\ncoronaDbg = None\ncoronaDbgThread = None\ncoronaBreakpointsSettings = None\ncoronaBreakpoints = {}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def debug(s):\n global debugFP\n global corona_sdk_debug\n try:\n if not debugFP and corona_sdk_debug:\n if not os.path.isdir(_corona_utils.PACKAGE_USER_DIR):\n os.makedirs(_corona_utils.PACKAGE_USER_DIR)\n debugFP = open(os.path.normpath(os.path.join(_corona_utils.PACKAGE_USER_DIR, \"debug.log\")), \"w\", 1)\n except:\n pass\n\n # <CoronaDebuggerThread(Thread-5, started 4583960576)>\n thread_id = re.sub(r'.*\\(([^,]*),.*', r'\\1', str(threading.current_thread()))\n log_line = str(datetime.datetime.now()) + \" (\" + str(thread_id) + \"): \" + str(s)\n if debugFP:\n debugFP.write(log_line + \"\\n\")\n _corona_utils.debug(log_line)", "metadata": "root.debug", "header": "['module', '___EOS___']", "index": 53 } ]
[ { "span": "except:", "start_line": 21, "start_column": 0, "end_line": 21, "end_column": 7 }, { "span": "except:", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 7 }, { "span": "except:", "start_line": 61, "start_column": 2, "end_line": 61, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Sub", "lim", "e", " ", "Text", " ", "plugin", " ", "to", " ", "support", " ", "Cor", "ona", " ", "Editor_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2013", " ", "Cor", "ona", " ", "Lab", "s", " ", "Inc", ".", " ", "A", " ", "mobile", " ", "develop", "ment", " ", "software", " ", "compan", "y", ".", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "MIT", " ", "License", " ", "-", " ", "see", " ", "https", "://", "raw", ".", "git", "hub", ".", "com", "/", "coro", "nal", "abs", "/", "Cor", "ona", "SD", "K", "-", "Sub", "lim", "e", "Text", "/", "master", "/", "LICENSE", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sublime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sublim", "e\\u", "plugin_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "queue_", "#", " ", "P3", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coro", "na", "Queue_", "=_", "queue_", "\\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 ", " _", "import_", "Queue_", "#", " ", "P2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coro", "na", "Queue_", "=_", "Queue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "console", "Output", "Q_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "variab", "les", "Output", "Q_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lua", "Stack", "Output", "Q_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "debugg", "er", "Cmd", "Q_", "=_", "None_", "\\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_", "._", "import_", "\\u", "coro", "na", "\\u", "utils_", "#", " ", "P3", "_", "\\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 ", " _", "import_", "\\u", "coro", "na", "\\u", "utils_", "#", " ", "P2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "dete", "rmin", "e", " ", "if", " ", "'", "obj", "'", " ", "is", " ", "a", " ", "string", " ", "in", " ", "bot", "h", " ", "Pyth", "on", " ", "2", ".", "x", " ", "and", " ", "3", ".", "x_", "\\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_", "status", "Region_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "change", " ", "our", " ", "behavior", " ", "to", " ", "avoid", " ", "compli", "cations", " ", "with", " ", "cert", "ain", " ", "Cor", "ona", "SD", "K", " ", "releases_", "\\u\\u\\uNL\\u\\u\\u_", "coro", "na", "\\u", "sd", "k", "\\u", "version_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", "ting", " ", "settings", " ", "in", " ", "cert", "ain", " ", "thread", "s", " ", "lock", "s", " ", "up", " ", "Sub", "lim", "e", " ", "Text", " ", "so", " ", "do", " ", "it", " ", "just", " ", "once_", "\\u\\u\\uNL\\u\\u\\u_", "coro", "na", "\\u", "sd", "k", "\\u", "debug_", "=_", "\\u", "coro", "na", "\\u", "utils_", "._", "Get", "Setting_", "(_", "\"", "coro", "na", "\\u", "sd", "k", "\\u", "debug", "\"_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "debug", "FP", "_", "=_", "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\\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_", "HOST_", "=_", "''_", "#", " ", "Symboli", "c", " ", "name", " ", "meaning", " ", "all", " ", "avail", "able", " ", "interfaces_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "PORT_", "=_", "817", "1_", "#", " ", "Arbit", "rar", "y", " ", "non", "-", "privilege", "d", " ", "port", ",", " ", "matche", "s", " ", "Simulator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "coro", "na", "Db", "g_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coro", "na", "Db", "g", "Thread_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coro", "na", "Breakpoint", "s", "Settings_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "coro", "na", "Breakpoint", "s_", "=_", "{_", "}_", "\\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\\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\\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_", "debug_", "(_", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "global_", "debug", "FP", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "coro", "na", "\\u", "sd", "k", "\\u", "debug_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "debug", "FP", "_", "and_", "coro", "na", "\\u", "sd", "k", "\\u", "debug_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "os_", "._", "path_", "._", "isdir_", "(_", "\\u", "coro", "na", "\\u", "utils_", "._", "PACKAG", "E", "\\u", "USER", "\\u", "DIR_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "\\u", "coro", "na", "\\u", "utils_", "._", "PACKAG", "E", "\\u", "USER", "\\u", "DIR_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "debug", "FP", "_", "=_", "open_", "(_", "os_", "._", "path_", "._", "normpath_", "(_", "os_", "._", "path_", "._", "join_", "(_", "\\u", "coro", "na", "\\u", "utils_", "._", "PACKAG", "E", "\\u", "USER", "\\u", "DIR_", ",_", "\"", "debug", ".", "log", "\"_", ")_", ")_", ",_", "\"", "w", "\"_", ",_", "1_", ")_", "\\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_", "#", " ", "<", "Cor", "ona", "Debugger", "Thread", "(", "Thread", "-", "5", ",", " ", "start", "ed", " ", "458", "396", "057", "6", ")>", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "thread", "\\u", "id_", "=_", "re_", "._", "sub_", "(_", "r", "'.*", "\\\\((", "[", "^", ",]", "*)", ",.", "*'_", ",_", "r", "'\\\\", "1", "'_", ",_", "str_", "(_", "threading_", "._", "current", "\\u", "thread_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log", "\\u", "line_", "=_", "str_", "(_", "datetime_", "._", "datetime_", "._", "now_", "(_", ")_", ")_", "+_", "\"", " ", "(\"_", "+_", "str_", "(_", "thread", "\\u", "id_", ")_", "+_", "\"):", " ", "\"_", "+_", "str_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "debug", "FP", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "debug", "FP", "_", "._", "write_", "(_", "log", "\\u", "line_", "+_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "coro", "na", "\\u", "utils_", "._", "debug_", "(_", "log", "\\u", "line_", ")_", "\\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, 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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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, 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 ]
Except block handles 'BaseException'
ipython/ipython-py3k/IPython/quarantine/ipy_jot.py
[ { "content": "def refresh_variables(ip, key=None):\n db = ip.db\n if key is None:\n keys = db.keys('jot/*')\n else:\n keys = db.keys('jot/'+key)\n for key in keys:\n # strip autorestore\n justkey = os.path.basename(key)\n print(\"Restoring from\", justkey, \"...\")\n try:\n obj = db[key]\n except KeyError:\n print(\"Unable to restore variable '%s', ignoring (use %%jot -d to forget!)\" % justkey)\n print(\"The error was:\",sys.exc_info()[0])\n else:\n #print \"restored\",justkey,\"=\",obj #dbg\n try:\n origname = obj.name\n except:\n ip.user_ns[justkey] = obj\n print(\"Restored\", justkey)\n else:\n ip.user_ns[origname] = obj['val']\n print(\"Restored\", origname) ", "metadata": "root.refresh_variables", "header": "['module', '___EOS___']", "index": 21 }, { "content": "def intm(n):\n try:\n return int(n)\n except:\n return 0", "metadata": "root.intm", "header": "['module', '___EOS___']", "index": 96 }, { "content": "def jot_obj(self, obj, name, comment=''):\n \"\"\"\n write obj data to the note database, with whatever that should be noted.\n \"\"\"\n had = self.db.keys('jot/'+name+'*')\n # if it the same name but a later version, we stupidly add a number to the \n # so the name doesn't collide. Any better idea?\n suffix = ''\n if len(had)>0:\n pre = os.path.commonprefix(had)\n suf = [n.split(pre)[1] for n in had]\n versions = list(map(intm, suf))\n suffix = str(max(versions)+1)\n\n uname = 'jot/'+name+suffix\n\n # which one works better? \n #all = ip.shadowhist.all()\n all = ip.shell.history_manager.input_hist_parsed\n\n # We may actually want to make snapshot of files that are run-ned.\n\n # get the comment \n try:\n comment = ip.magic_edit('-x').strip()\n except:\n print(\"No comment is recorded.\")\n comment = ''\n\n self.db[uname] = Struct({'val':obj, \n 'time' : datetime.now(), \n 'hist' : all,\n 'name' : name,\n 'comment' : comment,})\n\n print(\"Jotted down notes for '%s' (%s)\" % (uname, obj.__class__.__name__))", "metadata": "root.jot_obj", "header": "['module', '___EOS___']", "index": 102 }, { "content": "def magic_jot(self, parameter_s=''):\n \"\"\"Lightweight persistence for python variables.\n\n Example:\n \n ville@badger[~]|1> A = ['hello',10,'world']\\\\\n ville@badger[~]|2> %jot A\\\\\n ville@badger[~]|3> Exit\n \n (IPython session is closed and started again...)\n \n ville@badger:~$ ipython -p pysh\\\\\n ville@badger[~]|1> print A\n \n ['hello', 10, 'world']\n \n Usage:\n \n %jot - Show list of all variables and their current values\\\\\n %jot -l - Show list of all variables and their current values in detail\\\\\n %jot -l <var> - Show one variable and its current values in detail\\\\\n %jot <var> - Store the *current* value of the variable to disk\\\\\n %jot -d <var> - Remove the variable and its value from storage\\\\\n %jot -z - Remove all variables from storage (disabled)\\\\\n %jot -r <var> - Refresh/Load variable from jot (delete current vals)\\\\\n %jot foo >a.txt - Store value of foo to new file a.txt\\\\\n %jot foo >>a.txt - Append value of foo to file a.txt\\\\ \n \n It should be noted that if you change the value of a variable, you\n need to %note it again if you want to persist the new value.\n \n Note also that the variables will need to be pickleable; most basic\n python types can be safely %stored.\n \n \"\"\"\n \n opts,argsl = self.parse_options(parameter_s,'drzl',mode='string')\n args = argsl.split(None,1)\n ip = self.getapi()\n db = ip.db\n # delete\n if 'd' in opts:\n try:\n todel = args[0]\n except IndexError:\n error('You must provide the variable to forget')\n else:\n try:\n del db['jot/' + todel]\n except:\n error(\"Can't delete variable '%s'\" % todel)\n # reset the whole database\n elif 'z' in opts:\n print(\"reseting the whole database has been disabled.\")\n #for k in db.keys('autorestore/*'):\n # del db[k]\n\n elif 'r' in opts:\n try:\n toret = args[0]\n except:\n print(\"restoring all the variables jotted down...\")\n refresh_variables(ip)\n else:\n refresh_variables(ip, toret)\n\n elif 'l' in opts:\n try:\n tolist = args[0]\n except:\n print(\"List details for all the items.\")\n detail_variables(ip)\n else:\n print(\"Details for\", tolist, \":\")\n detail_variables(ip, tolist)\n \n # run without arguments -> list noted variables & notes \n elif not args:\n vars = self.db.keys('jot/*')\n vars.sort() \n if vars:\n size = max(list(map(len,vars))) - 4 \n else:\n size = 0\n \n print('Variables and their in-db values:')\n fmt = '%-'+str(size)+'s [%s] -> %s'\n get = db.get\n for var in vars:\n justkey = os.path.basename(var)\n v = get(var,'<unavailable>')\n try: \n print(fmt % (justkey,\\\n datetime.ctime(v.get('time','<unavailable>')),\\\n v.get('comment','<unavailable>')[:70].replace('\\n',' '),))\n except AttributeError:\n print(fmt % (justkey, '<unavailable>', '<unavailable>', repr(v)[:50]))\n\n \n # default action - store the variable\n else:\n # %store foo >file.txt or >>file.txt\n if len(args) > 1 and args[1].startswith('>'):\n fnam = os.path.expanduser(args[1].lstrip('>').lstrip())\n if args[1].startswith('>>'):\n fil = open(fnam,'a')\n else:\n fil = open(fnam,'w')\n obj = ip.ev(args[0])\n print(\"Writing '%s' (%s) to file '%s'.\" % (args[0],\n obj.__class__.__name__, fnam))\n\n \n if not isinstance (obj,str):\n from pprint import pprint\n pprint(obj,fil)\n else:\n fil.write(obj)\n if not obj.endswith('\\n'):\n fil.write('\\n')\n \n fil.close()\n return\n \n # %note foo\n try:\n obj = ip.user_ns[args[0]]\n except KeyError:\n # this should not be alias, for aliases, use %store\n print()\n print(\"Error: %s doesn't exist.\" % args[0])\n print() \n print(\"Use %note -r <var> to retrieve variables. This should not be used \" +\\\n \"to store alias, for saving aliases, use %store\") \n return\n else:\n if isinstance(inspect.getmodule(obj), FakeModule):\n print(textwrap.dedent(\"\"\"\\\n Warning:%s is %s \n Proper storage of interactively declared classes (or instances\n of those classes) is not possible! Only instances\n of classes in real modules on file system can be %%store'd.\n \"\"\" % (args[0], obj) )) \n return\n #pickled = pickle.dumps(obj)\n #self.db[ 'jot/' + args[0] ] = obj\n jot_obj(self, obj, args[0])", "metadata": "root.magic_jot", "header": "['module', '___EOS___']", "index": 141 }, { "content": "def magic_read(self, parameter_s=''):\n \"\"\" \n %read <var> - Load variable from data that is jotted down.\\\\\n \n \"\"\"\n \n opts,argsl = self.parse_options(parameter_s,'drzl',mode='string')\n args = argsl.split(None,1)\n ip = self.getapi()\n db = ip.db\n #if opts.has_key('r'):\n try:\n toret = args[0]\n except:\n print(\"which record do you want to read out?\")\n return\n else:\n return read_variables(ip, toret)", "metadata": "root.magic_read", "header": "['module', '___EOS___']", "index": 290 } ]
[ { "span": "except:", "start_line": 40, "start_column": 12, "end_line": 40, "end_column": 19 }, { "span": "except:", "start_line": 99, "start_column": 4, "end_line": 99, "end_column": 11 }, { "span": "except:", "start_line": 127, "start_column": 4, "end_line": 127, "end_column": 11 }, { "span": "except:", "start_line": 190, "start_column": 12, "end_line": 190, "end_column": 19 }, { "span": "except:", "start_line": 201, "start_column": 8, "end_line": 201, "end_column": 15 }, { "span": "except:", "start_line": 210, "start_column": 8, "end_line": 210, "end_column": 15 }, { "span": "except:", "start_line": 303, "start_column": 4, "end_line": 303, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "refre", "sh", "\\u", "variables_", "(_", "ip_", ",_", "key_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "=_", "ip_", "._", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "key_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keys_", "=_", "db_", "._", "keys_", "(_", "'", "jo", "t", "/*'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keys_", "=_", "db_", "._", "keys_", "(_", "'", "jo", "t", "/'_", "+_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "key_", "in_", "keys_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "strip", " ", "autore", "store_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "just", "key_", "=_", "os_", "._", "path_", "._", "basename_", "(_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Restor", "ing", " ", "from", "\"_", ",_", "just", "key_", ",_", "\"...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "db_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "Una", "ble", " ", "to", " ", "restore", " ", "variab", "le", " ", "'%", "s", "',", " ", "ign", "orin", "g", " ", "(", "use", " ", "%%", "jo", "t", " ", "-", "d", " ", "to", " ", "forget", "!)", "\"_", "%_", "just", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "The", " ", "error", " ", "was", ":\"_", ",_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "restore", "d", "\",", "just", "key", ",\"", "=\"", ",", "obj", " ", "#", "dbg_", "\\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 ", " _", "orig", "name_", "=_", "obj_", "._", "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 ", " _", "ip_", "._", "user", "\\u", "ns_", "[_", "just", "key_", "]_", "=_", "obj_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Restor", "ed", "\"_", ",_", "just", "key_", ")_", "\\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 ", " _", "ip_", "._", "user", "\\u", "ns_", "[_", "orig", "name_", "]_", "=_", "obj_", "[_", "'", "val", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Restor", "ed", "\"_", ",_", "orig", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "int", "m_", "(_", "n_", ")_", ":_", "\\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_", "int_", "(_", "n_", ")_", "\\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 ", " _", "return_", "0_", "\\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_", "jo", "t", "\\u", "obj_", "(_", "self_", ",_", "obj_", ",_", "name_", ",_", "comment_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "write", " ", "obj", " ", "data", " ", "to", " ", "the", " ", "note", " ", "databa", "se", ",", " ", "with", " ", "what", "ever", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "note", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "had", "_", "=_", "self_", "._", "db_", "._", "keys_", "(_", "'", "jo", "t", "/'_", "+_", "name_", "+_", "'*'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "it", " ", "the", " ", "same", " ", "name", " ", "but", " ", "a", " ", "late", "r", " ", "version", ",", " ", "we", " ", "stu", "pid", "ly", " ", "add", " ", "a", " ", "number", " ", "to", " ", "the", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "the", " ", "name", " ", "doe", "sn", "'", "t", " ", "collide", ".", " ", "Any", " ", "bett", "er", " ", "idea", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "suffix_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "had", "_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pre_", "=_", "os_", "._", "path_", "._", "common", "prefix_", "(_", "had", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suf", "_", "=_", "[_", "n_", "._", "split_", "(_", "pre_", ")_", "[_", "1_", "]_", "for_", "n_", "in_", "had", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "versions_", "=_", "list_", "(_", "map_", "(_", "int", "m_", ",_", "suf", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "suffix_", "=_", "str_", "(_", "max_", "(_", "versions_", ")_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "uname_", "=_", "'", "jo", "t", "/'_", "+_", "name_", "+_", "suffix_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whi", "ch", " ", "one", " ", "works", " ", "bett", "er", "?", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", "all", " ", "=", " ", "ip", ".", "shadow", "hist", ".", "all", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "all_", "=_", "ip_", "._", "shell_", "._", "histo", "ry", "\\u", "manager_", "._", "input", "\\u", "hist", "\\u", "parsed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "may", " ", "actual", "ly", " ", "want", " ", "to", " ", "make", " ", "snapshot", " ", "of", " ", "files", " ", "tha", "t", " ", "are", " ", "run", "-", "ned", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "comment", " _", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "comment_", "=_", "ip_", "._", "magic", "\\u", "edit_", "(_", "'-", "x", "'_", ")_", "._", "strip_", "(_", ")_", "\\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_", "(_", "\"", "No", " ", "comment", " ", "is", " ", "recorde", "d", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "comment_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "db_", "[_", "uname_", "]_", "=_", "Struct_", "(_", "{_", "'", "val", "'_", ":_", "obj_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "time", "'_", ":_", "datetime_", "._", "now_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "hist", "'_", ":_", "all_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "comment", "'_", ":_", "comment_", ",_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "Jo", "tted", " ", "down", " ", "note", "s", " ", "for", " ", "'%", "s", "'", " ", "(%", "s", ")\"_", "%_", "(_", "uname_", ",_", "obj_", "._", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "magic", "\\u", "jo", "t_", "(_", "self_", ",_", "parameter", "\\u", "s_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Light", "weight", " ", "persiste", "nce", " ", "for", " ", "python", " ", "variab", "les", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Exam", "ple", ":", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "vil", "le", "@", "badge", "r", "[~", "]|", "1", ">", " ", "A", " ", "=", " ", "['", "hell", "o", "',", "10", ",'", "world", "']", "\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", "vil", "le", "@", "badge", "r", "[~", "]|", "2", ">", " ", "%", "jo", "t", " ", "A", "\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", "vil", "le", "@", "badge", "r", "[~", "]|", "3", ">", " ", "Exi", "t", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "(", "IP", "yth", "on", " ", "session", " ", "is", " ", "close", "d", " ", "and", " ", "start", "ed", " ", "again", "...)", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "vil", "le", "@", "badge", "r", ":", "~", "$", " ", "ipython", " ", "-", "p", " ", "pys", "h", "\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", "vil", "le", "@", "badge", "r", "[~", "]|", "1", ">", " ", "print", " ", "A", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "['", "hell", "o", "',", " ", "10", ",", " ", "'", "world", "']", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Us", "age", ":", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "%", "jo", "t", " ", " ", "-", " ", "Show", " ", "list", " ", "of", " ", "all", " ", "variab", "les", " ", "and", " ", "thei", "r", " ", "current", " ", "values", "\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", "%", "jo", "t", " ", "-", "l", " ", " ", " ", "-", " ", "Show", " ", "list", " ", "of", " ", "all", " ", "variab", "les", " ", "and", " ", "thei", "r", " ", "current", " ", "values", " ", "in", " ", "deta", "il", "\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", "%", "jo", "t", " ", "-", "l", " ", "<", "var", ">", " ", "-", " ", "Show", " ", "one", " ", "variab", "le", " ", "and", " ", "its", " ", "current", " ", "values", " ", "in", " ", "deta", "il", "\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", "%", "jo", "t", " ", "<", "var", ">", " ", " ", " ", " ", "-", " ", "Stor", "e", " ", "the", " ", "*", "current", "*", " ", "value", " ", "of", " ", "the", " ", "variab", "le", " ", "to", " ", "disk", "\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", "%", "jo", "t", " ", "-", "d", " ", "<", "var", ">", " ", "-", " ", "Remove", " ", "the", " ", "variab", "le", " ", "and", " ", "its", " ", "value", " ", "from", " ", "storage", "\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", "%", "jo", "t", " ", "-", "z", " ", " ", " ", "-", " ", "Remove", " ", "all", " ", "variab", "les", " ", "from", " ", "storage", " ", "(", "disable", "d", ")\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", "%", "jo", "t", " ", "-", "r", " ", "<", "var", ">", " ", "-", " ", "Refr", "esh", "/", "Load", " ", "variab", "le", " ", "from", " ", "jo", "t", " ", "(", "delete", " ", "current", " ", "vals", ")\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", "%", "jo", "t", " ", "foo", " ", ">", "a", ".", "txt", " ", " ", "-", " ", "Stor", "e", " ", "value", " ", "of", " ", "foo", " ", "to", " ", "new", " ", "file", " ", "a", ".", "txt", "\\\\\\\\", "\\", "10", ";", " ", " ", " ", " ", "%", "jo", "t", " ", "foo", " ", ">>", "a", ".", "txt", " ", "-", " ", "Append", " ", "value", " ", "of", " ", "foo", " ", "to", " ", "file", " ", "a", ".", "txt", "\\\\\\\\", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "It", " ", "shou", "ld", " ", "be", " ", "note", "d", " ", "tha", "t", " ", "if", " ", "you", " ", "change", " ", "the", " ", "value", " ", "of", " ", "a", " ", "variab", "le", ",", " ", "you", "\\", "10", ";", " ", " ", " ", " ", "need", " ", "to", " ", "%", "note", " ", "it", " ", "again", " ", "if", " ", "you", " ", "want", " ", "to", " ", "persist", " ", "the", " ", "new", " ", "value", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", " ", "als", "o", " ", "tha", "t", " ", "the", " ", "variab", "les", " ", "will", " ", "need", " ", "to", " ", "be", " ", "pickle", "able", ";", " ", "most", " ", "basic", "\\", "10", ";", " ", " ", " ", " ", "python", " ", "types", " ", "can", " ", "be", " ", "safe", "ly", " ", "%", "store", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "opts_", ",_", "args", "l_", "=_", "self_", "._", "parse", "\\u", "options_", "(_", "parameter", "\\u", "s_", ",_", "'", "dr", "zl", "'_", ",_", "mode_", "=_", "'", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "args", "l_", "._", "split_", "(_", "None_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip_", "=_", "self_", "._", "geta", "pi_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "=_", "ip_", "._", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "delete_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "d", "'_", "in_", "opts_", ":_", "\\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 ", " _", "tod", "el_", "=_", "args_", "[_", "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 ", " _", "error_", "(_", "'", "You", " ", "must", " ", "provide", " ", "the", " ", "variab", "le", " ", "to", " ", "forget", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "del_", "db_", "[_", "'", "jo", "t", "/'_", "+_", "tod", "el_", "]_", "\\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 ", " _", "error_", "(_", "\"", "Can", "'", "t", " ", "delete", " ", "variab", "le", " ", "'%", "s", "'\"_", "%_", "tod", "el_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "reset", " ", "the", " ", "whole", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "z", "'_", "in_", "opts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "\"", "reset", "ing", " ", "the", " ", "whole", " ", "databa", "se", " ", "has", " ", "bee", "n", " ", "disable", "d", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "for", " ", "k", " ", "in", " ", "db", ".", "keys", "('", "autore", "store", "/*", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "del", " ", "db", "[", "k", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "'", "r", "'_", "in_", "opts_", ":_", "\\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 ", " _", "tore", "t_", "=_", "args_", "[_", "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 ", " _", "print_", "(_", "\"", "resto", "ring", " ", "all", " ", "the", " ", "variab", "les", " ", "jo", "tted", " ", "down", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "refre", "sh", "\\u", "variables_", "(_", "ip_", ")_", "\\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 ", " _", "refre", "sh", "\\u", "variables_", "(_", "ip_", ",_", "tore", "t_", ")_", "\\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_", "'", "l", "'_", "in_", "opts_", ":_", "\\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 ", " _", "tolist_", "=_", "args_", "[_", "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 ", " _", "print_", "(_", "\"", "List", " ", "deta", "il", "s", " ", "for", " ", "all", " ", "the", " ", "items", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deta", "il", "\\u", "variables_", "(_", "ip_", ")_", "\\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_", "(_", "\"", "Det", "ail", "s", " ", "for", "\"_", ",_", "tolist_", ",_", "\":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deta", "il", "\\u", "variables_", "(_", "ip_", ",_", "tolist_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "run", " ", "with", "out", " ", "argu", "ment", "s", " ", "->", " ", "list", " ", "note", "d", " ", "variab", "les", " ", "&", " ", "note", "s", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "not_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vars_", "=_", "self_", "._", "db_", "._", "keys_", "(_", "'", "jo", "t", "/*'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vars_", "._", "sort_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "vars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "max_", "(_", "list_", "(_", "map_", "(_", "len_", ",_", "vars_", ")_", ")_", ")_", "-_", "4_", "\\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 ", " _", "size_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "(_", "'", "Varia", "bles", " ", "and", " ", "thei", "r", " ", "in", "-", "db", " ", "values", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fmt_", "=_", "'%", "-'_", "+_", "str_", "(_", "size_", ")_", "+_", "'", "s", " ", "[", "%", "s", "]", " ", "->", " ", "%", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get_", "=_", "db_", "._", "get_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "var_", "in_", "vars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "just", "key_", "=_", "os_", "._", "path_", "._", "basename_", "(_", "var_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v_", "=_", "get_", "(_", "var_", ",_", "'<", "unava", "ilab", "le", ">'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "fmt_", "%_", "(_", "just", "key_", ",_", "datetime_", "._", "ctime_", "(_", "v_", "._", "get_", "(_", "'", "time", "'_", ",_", "'<", "unava", "ilab", "le", ">'_", ")_", ")_", ",_", "v_", "._", "get_", "(_", "'", "comment", "'_", ",_", "'<", "unava", "ilab", "le", ">'_", ")_", "[_", ":_", "70_", "]_", "._", "replace_", "(_", "'\\\\", "n", "'_", ",_", "'", " ", "'_", ")_", ",_", ")_", ")_", "\\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 ", " _", "print_", "(_", "fmt_", "%_", "(_", "just", "key_", ",_", "'<", "unava", "ilab", "le", ">'_", ",_", "'<", "unava", "ilab", "le", ">'_", ",_", "repr_", "(_", "v_", ")_", "[_", ":_", "50_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "default", " ", "action", " ", "-", " ", "store", " ", "the", " ", "variable_", "\\u\\u\\uNL\\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_", "#", " ", "%", "store", " ", "foo", " ", ">", "file", ".", "txt", " ", "or", " ", ">>", "file", ".", "txt_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "args_", ")_", ">_", "1_", "and_", "args_", "[_", "1_", "]_", "._", "startswith_", "(_", "'>'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fna", "m_", "=_", "os_", "._", "path_", "._", "expanduser_", "(_", "args_", "[_", "1_", "]_", "._", "lstrip_", "(_", "'>'_", ")_", "._", "lstrip_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", "[_", "1_", "]_", "._", "startswith_", "(_", "'>>", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fil_", "=_", "open_", "(_", "fna", "m_", ",_", "'", "a", "'_", ")_", "\\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 ", " _", "fil_", "=_", "open_", "(_", "fna", "m_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "obj_", "=_", "ip_", "._", "ev_", "(_", "args_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Writ", "ing", " ", "'%", "s", "'", " ", "(%", "s", ")", " ", "to", " ", "file", " ", "'%", "s", "'.\"_", "%_", "(_", "args_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "obj_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "fna", "m_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "isinstance_", "(_", "obj_", ",_", "str_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "pprint_", "import_", "pprint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pprint_", "(_", "obj_", ",_", "fil_", ")_", "\\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 ", " _", "fil_", "._", "write_", "(_", "obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "obj_", "._", "endswith_", "(_", "'\\\\", "n", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "fil_", "._", "write_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "fil_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "%", "note", " ", "foo_", "\\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_", "=_", "ip_", "._", "user", "\\u", "ns_", "[_", "args_", "[_", "0_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "this", " ", "shou", "ld", " ", "not", " ", "be", " ", "alias", ",", " ", "for", " ", "alias", "es", ",", " ", "use", " ", "%", "store_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Error", ":", " ", "%", "s", " ", "doe", "sn", "'", "t", " ", "exist", ".\"_", "%_", "args_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "Us", "e", " ", "%", "note", " ", "-", "r", " ", "<", "var", ">", " ", "to", " ", "retrieve", " ", "variab", "les", ".", " ", "Thi", "s", " ", "shou", "ld", " ", "not", " ", "be", " ", "used", " ", "\"_", "+_", "\"", "to", " ", "store", " ", "alias", ",", " ", "for", " ", "saving", " ", "alias", "es", ",", " ", "use", " ", "%", "store", "\"_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "if_", "isinstance_", "(_", "inspect_", "._", "getm", "odule_", "(_", "obj_", ")_", ",_", "Fake", "Module_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "textwrap_", "._", "dedent_", "(_", "\"\"\"", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "Warn", "ing", ":", "%", "s", " ", "is", " ", "%", "s", " ", "\\", "10", ";", " ", " ", " ", " ", "Proper", " ", "storage", " ", "of", " ", "interactive", "ly", " ", "declared", " ", "classe", "s", " ", "(", "or", " ", "instance", "s", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "tho", "se", " ", "classe", "s", ")", " ", "is", " ", "not", " ", "possib", "le", "!", " ", "On", "ly", " ", "instance", "s", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "classe", "s", " ", "in", " ", "real", " ", "module", "s", " ", "on", " ", "file", " ", "system", " ", "can", " ", "be", " ", "%%", "store", "'", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "%_", "(_", "args_", "[_", "0_", "]_", ",_", "obj_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "pickled", " ", "=", " ", "pickle", ".", "dump", "s", "(", "obj", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "self", ".", "db", "[", " ", "'", "jo", "t", "/'", " ", "+", " ", "args", "[", "0", "]", " ", "]", " ", "=", " ", "obj_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "jo", "t", "\\u", "obj_", "(_", "self_", ",_", "obj_", ",_", "args_", "[_", "0_", "]_", ")_", "\\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_", "magic", "\\u", "read_", "(_", "self_", ",_", "parameter", "\\u", "s_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "%", "read", " ", "<", "var", ">", " ", "-", " ", "Load", " ", "variab", "le", " ", "from", " ", "data", " ", "tha", "t", " ", "is", " ", "jo", "tted", " ", "down", ".\\\\", "\\\\", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "opts_", ",_", "args", "l_", "=_", "self_", "._", "parse", "\\u", "options_", "(_", "parameter", "\\u", "s_", ",_", "'", "dr", "zl", "'_", ",_", "mode_", "=_", "'", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "args", "l_", "._", "split_", "(_", "None_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ip_", "=_", "self_", "._", "geta", "pi_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "=_", "ip_", "._", "db_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "opts", ".", "has", "\\u", "key", "('", "r", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tore", "t_", "=_", "args_", "[_", "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 ", " _", "print_", "(_", "\"", "whi", "ch", " ", "record", " ", "do", " ", "you", " ", "want", " ", "to", " ", "read", " ", "out", "?\"_", ")_", "\\u\\u\\uNEWLINE\\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 ", " _", "return_", "read", "\\u", "variables_", "(_", "ip_", ",_", "tore", "t_", ")_", "\\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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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, 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, 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 ]
Unused import
cloudera/hue/desktop/core/src/desktop/migrations/0019_auto.py
[ { "content": "# -*- coding: utf-8 -*-\nfrom south.utils import datetime_utils as datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Migration(SchemaMigration):\n\n\n\n\n\n models = {\n u'auth.group': {\n 'Meta': {'object_name': 'Group'},\n u'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': u\"orm['auth.Permission']\", 'symmetrical': 'False', 'blank': 'True'})\n },\n u'auth.permission': {\n 'Meta': {'ordering': \"(u'content_type__app_label', u'content_type__model', u'codename')\", 'unique_together': \"((u'content_type', u'codename'),)\", 'object_name': 'Permission'},\n 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['contenttypes.ContentType']\"}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})\n },\n u'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', [], {'symmetrical': 'False', 'related_name': \"u'user_set'\", 'blank': 'True', 'to': u\"orm['auth.Group']\"}),\n u'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', [], {'symmetrical': 'False', 'related_name': \"u'user_set'\", 'blank': 'True', 'to': u\"orm['auth.Permission']\"}),\n 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})\n },\n u'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 u'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 u'desktop.document': {\n 'Meta': {'unique_together': \"(('content_type', 'object_id'),)\", 'object_name': 'Document'},\n 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['contenttypes.ContentType']\"}),\n 'description': ('django.db.models.fields.TextField', [], {'default': \"''\"}),\n 'extra': ('django.db.models.fields.TextField', [], {'default': \"''\"}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'default': \"''\", 'max_length': '255'}),\n 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),\n 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'doc_owner'\", 'to': u\"orm['auth.User']\"}),\n 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': u\"orm['desktop.DocumentTag']\", 'db_index': 'True', 'symmetrical': 'False'}),\n 'version': ('django.db.models.fields.SmallIntegerField', [], {'default': '1'})\n },\n u'desktop.document2': {\n 'Meta': {'ordering': \"['-last_modified']\", 'unique_together': \"(('uuid', 'version', 'is_history'),)\", 'object_name': 'Document2'},\n 'data': ('django.db.models.fields.TextField', [], {'default': \"'{}'\"}),\n 'dependencies': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': \"'dependencies_rel_+'\", 'db_index': 'True', 'to': u\"orm['desktop.Document2']\"}),\n 'description': ('django.db.models.fields.TextField', [], {'default': \"''\"}),\n 'extra': ('django.db.models.fields.TextField', [], {'default': \"''\"}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'is_history': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),\n 'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),\n 'name': ('django.db.models.fields.CharField', [], {'default': \"''\", 'max_length': '255'}),\n 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': \"'doc2_owner'\", 'to': u\"orm['auth.User']\"}),\n 'parent_directory': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': \"'children'\", 'null': 'True', 'to': u\"orm['desktop.Document2']\"}),\n 'type': ('django.db.models.fields.CharField', [], {'default': \"''\", 'max_length': '32', 'db_index': 'True'}),\n 'uuid': ('django.db.models.fields.CharField', [], {'default': \"'98dbb51e-c86b-4e1d-800e-c26d5db4cb82'\", 'max_length': '36', 'db_index': 'True'}),\n 'version': ('django.db.models.fields.SmallIntegerField', [], {'default': '1', 'db_index': 'True'})\n },\n u'desktop.document2permission': {\n 'Meta': {'unique_together': \"(('doc', 'perms'),)\", 'object_name': 'Document2Permission'},\n 'all': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),\n 'doc': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['desktop.Document2']\"}),\n 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'to': u\"orm['auth.Group']\", 'db_table': \"'documentpermission2_groups'\", 'symmetrical': 'False'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'perms': ('django.db.models.fields.CharField', [], {'default': \"'read'\", 'max_length': '10', 'db_index': 'True'}),\n 'users': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'to': u\"orm['auth.User']\", 'db_table': \"'documentpermission2_users'\", 'symmetrical': 'False'})\n },\n u'desktop.documentpermission': {\n 'Meta': {'unique_together': \"(('doc', 'perms'),)\", 'object_name': 'DocumentPermission'},\n 'doc': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['desktop.Document']\"}),\n 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'to': u\"orm['auth.Group']\", 'db_table': \"'documentpermission_groups'\", 'symmetrical': 'False'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'perms': ('django.db.models.fields.CharField', [], {'default': \"'read'\", 'max_length': '10'}),\n 'users': ('django.db.models.fields.related.ManyToManyField', [], {'db_index': 'True', 'to': u\"orm['auth.User']\", 'db_table': \"'documentpermission_users'\", 'symmetrical': 'False'})\n },\n u'desktop.documenttag': {\n 'Meta': {'unique_together': \"(('owner', 'tag'),)\", 'object_name': 'DocumentTag'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['auth.User']\"}),\n 'tag': ('django.db.models.fields.SlugField', [], {'max_length': '50'})\n },\n u'desktop.settings': {\n 'Meta': {'object_name': 'Settings'},\n 'collect_usage': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'tours_and_tutorials': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'})\n },\n u'desktop.userpreferences': {\n 'Meta': {'object_name': 'UserPreferences'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'key': ('django.db.models.fields.CharField', [], {'max_length': '20'}),\n 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['auth.User']\"}),\n 'value': ('django.db.models.fields.TextField', [], {'max_length': '4096'})\n }\n }\n\n complete_apps = ['desktop']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 7 }, { "content": " def forwards(self, orm):\n # Removing M2M table for field tags on 'Document2'\n db.delete_table(db.shorten_name(u'desktop_document2_tags'))", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 9 }, { "content": " def backwards(self, orm):\n # Adding M2M table for field tags on 'Document2'\n m2m_table_name = db.shorten_name(u'desktop_document2_tags')\n db.create_table(m2m_table_name, (\n ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),\n ('from_document2', models.ForeignKey(orm[u'desktop.document2'], null=False)),\n ('to_document2', models.ForeignKey(orm[u'desktop.document2'], null=False))\n ))\n db.create_unique(m2m_table_name, ['from_document2_id', 'to_document2_id'])", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 14 } ]
[ { "span": "from south.utils import datetime_utils as datetime", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 50 } ]
[]
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_", "south_", "._", "utils_", "import_", "datetime", "\\u", "utils_", "as_", "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_", "[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\\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_", "models_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "auth", ".", "group", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Group", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\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", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "auth", ".", "permissi", "on", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"(", "u", "'", "content", "\\u", "type\\u\\u", "app", "\\u", "label", "',", " ", "u", "'", "content", "\\u", "type\\u\\u", "model", "',", " ", "u", "'", "code", "name", "')\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "(", "u", "'", "content", "\\u", "type", "',", " ", "u", "'", "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", "'_", ":_", "u", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\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_", "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", "'_", ",_", "[_", "]_", ",_", "{_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"", "u", "'", "user", "\\u", "set", "'\"_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "Group", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\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", "'_", ",_", "[_", "]_", ",_", "{_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"", "u", "'", "user", "\\u", "set", "'\"_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "Permi", "ssion", "']\"_", "}_", ")_", ",_", "\\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_", "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_", "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_", "u", "'", "desk", "top", ".", "document", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "content", "\\u", "type", "',", " ", "'", "object\\u", "id", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Document", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "content", "\\u", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "contenttype", "s", ".", "Conten", "t", "Type", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "extra", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "modifi", "ed", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "object\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Posi", "tiv", "e", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "owner", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "doc", "\\u", "owner", "'\"_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tags", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "desk", "top", ".", "Document", "Ta", "g", "']\"_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "version", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Small", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "1", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "desk", "top", ".", "document", "2", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "orderi", "ng", "'_", ":_", "\"[", "'-", "last", "\\u", "modifi", "ed", "']\"_", ",_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "uuid", "',", " ", "'", "version", "',", " ", "'", "is", "\\u", "histo", "ry", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Document", "2", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "data", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'{", "}'\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dependen", "cies", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "dependen", "cies", "\\u", "rel", "\\u", "+'\"", "_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "desk", "top", ".", "Document", "2", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "extra", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "is", "\\u", "histo", "ry", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Fal", "se", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "modifi", "ed", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Date", "Time", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "auto", "\\u", "now", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "owner", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "doc2", "\\u", "owner", "'\"_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "parent", "\\u", "director", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "relate", "d\\u", "name", "'_", ":_", "\"'", "child", "ren", "'\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "desk", "top", ".", "Document", "2", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"''\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "32", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "uuid", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "98", "db", "b5", "1e-", "c8", "6b", "-", "4e", "1d", "-", "800", "e-", "c2", "6d", "5d", "b4", "cb", "8", "2", "'\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "3", "6", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "version", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Small", "Integer", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "1", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "desk", "top", ".", "document", "2p", "erm", "ission", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "doc", "',", " ", "'", "perm", "s", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Document", "2", "Permi", "ssion", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "all", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "doc", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "desk", "top", ".", "Document", "2", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "Group", "']\"_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "document", "permissi", "on2", "\\u", "group", "s", "'\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "perm", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "read", "'\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "10", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "users", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "User", "']\"_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "document", "permissi", "on2", "\\u", "users", "'\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "desk", "top", ".", "document", "permissi", "on", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "doc", "',", " ", "'", "perm", "s", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Document", "Permi", "ssion", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "doc", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "desk", "top", ".", "Document", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "group", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "Group", "']\"_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "document", "permissi", "on", "\\u", "group", "s", "'\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "perm", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "read", "'\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "10", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "users", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Many", "To", "Many", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "User", "']\"_", ",_", "'", "db", "\\u", "table", "'_", ":_", "\"'", "document", "permissi", "on", "\\u", "users", "'\"_", ",_", "'", "symmetric", "al", "'_", ":_", "'", "Fal", "se", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "desk", "top", ".", "document", "tag", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "unique", "\\u", "tog", "ether", "'_", ":_", "\"(", "('", "owner", "',", " ", "'", "tag", "'),)\"_", ",_", "'", "object\\u", "name", "'_", ":_", "'", "Document", "Ta", "g", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "owner", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tag", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Sl", "ug", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "desk", "top", ".", "settings", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Sett", "ings", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "collect", "\\u", "usage", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tour", "s", "\\u", "and", "\\u", "tutorial", "s", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Boo", "lean", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "desk", "top", ".", "userp", "reference", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "User", "Preference", "s", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "primary", "\\u", "key", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "key", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "u", "\"", "orm", "['", "auth", ".", "User", "']\"_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "value", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "409", "6", "'_", "}_", ")_", "\\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_", "=_", "[_", "'", "desk", "top", "'_", "]_", "[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_", "#", " ", "Remo", "ving", " ", "M2", "M", " ", "table", " ", "for", " ", "field", " ", "tags", " ", "on", " ", "'", "Document", "2", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "delete", "\\u", "table_", "(_", "db_", "._", "shorten", "\\u", "name_", "(_", "u", "'", "desk", "top", "\\u", "document", "2", "\\u", "tags", "'_", ")_", ")_", "\\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_", "#", " ", "Add", "ing", " ", "M2", "M", " ", "table", " ", "for", " ", "field", " ", "tags", " ", "on", " ", "'", "Document", "2", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "m2", "m", "\\u", "table", "\\u", "name_", "=_", "db_", "._", "shorten", "\\u", "name_", "(_", "u", "'", "desk", "top", "\\u", "document", "2", "\\u", "tags", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "create", "\\u", "table_", "(_", "m2", "m", "\\u", "table", "\\u", "name_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "id", "'_", ",_", "models_", "._", "Auto", "Field_", "(_", "verbo", "se", "\\u", "name_", "=_", "'", "ID", "'_", ",_", "primary", "\\u", "key_", "=_", "True_", ",_", "auto", "\\u", "created_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "from", "\\u", "document", "2", "'_", ",_", "models_", "._", "Fore", "ign", "Key_", "(_", "orm_", "[_", "u", "'", "desk", "top", ".", "document", "2", "'_", "]_", ",_", "null_", "=_", "False_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "to", "\\u", "document", "2", "'_", ",_", "models_", "._", "Fore", "ign", "Key_", "(_", "orm_", "[_", "u", "'", "desk", "top", ".", "document", "2", "'_", "]_", ",_", "null_", "=_", "False_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "create", "\\u", "unique_", "(_", "m2", "m", "\\u", "table", "\\u", "name_", ",_", "[_", "'", "from", "\\u", "document", "2", "\\u", "id", "'_", ",_", "'", "to", "\\u", "document", "2", "\\u", "id", "'_", "]_", ")_", "\\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, 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, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused import
tjguk/networkzero/networkzero/discovery.py
[ { "content": "# -*- coding: utf-8 -*-\n\"\"\"Advertise and collect advertisements of network services\n\nThe discovery module offers:\n\n * A UDP broadcast socket which:\n \n - Listens for and keeps track of service adverts from this and other \n machines & processes\n - Broadcasts services advertised by this process\n\n * A ZeroMQ socket which allow any process on this machine to \n communicate with its broadcast socket\n\nIn other words, we have a beacon which listens to instructions\nfrom processes on this machine while sending out and listening \nto adverts broadcast to/from all machines on the network.\n\nThe beacon is started automatically in a daemon thread when the first \nattempt is made to advertise or discover. If another process already \nhas a beacon running (ie if this beacon can't bind to its port) this \nbeacon thread will shut down with no further action.\n\nThe module-level functions to advertise and discover will open a connection\nto a ZeroMQ socket on this machine (which might be hosted by this or by another\nprocess) and will use this socket to send commands to the beacon thread which\nwill update or return its internal list of advertised services.\n\nAs an additional convenience, the :func:`advertise` function will, if given no\nspecific address, generate a suitable ip:port pair by interrogating the system.\nThis functionality is actually in :func:`core.address` (qv).\n\"\"\"\nimport os, sys\nimport collections\nimport errno\nimport json\nimport socket\nimport threading\nimport time\n\nimport zmq\n\nfrom . import config\nfrom . import core\nfrom . import sockets\n\n_logger = core.get_logger(__name__)\n\n#\n# Continue is a sentinel value to indicate that a command\n# has completed its scheduled slice without producing a result\n# and without exceeding its overall timeout.\n#\nContinue = object()\n\n#\n# Empty is a sentinel to distinguish between no result and a result of None\n#\nEmpty = object()\n\n\n \n \n\n\n\n\n_beacon = None\n_remote_beacon = object()\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n _start_beacon()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def _unpack(message):\n return json.loads(message.decode(config.ENCODING))", "metadata": "root._unpack", "header": "['module', '___EOS___']", "index": 60 }, { "content": "def _pack(message):\n return json.dumps(message).encode(config.ENCODING)", "metadata": "root._pack", "header": "['module', '___EOS___']", "index": 63 }, { "content": "def timed_out(started_at, wait_for_s):\n #\n # If the wait time is the sentinel value FOREVER, never time out\n # Otherwise time out if the current time is more than wait_for_s seconds after the start time\n #\n if wait_for_s is config.FOREVER:\n return False\n else:\n return time.time() > started_at + wait_for_s", "metadata": "root.timed_out", "header": "['module', '___EOS___']", "index": 66 }, { "content": "def _bind_with_timeout(bind_function, args, n_tries=3, retry_interval_s=0.5):\n \"\"\"Attempt to bind a socket a number of times with a short interval in between\n \n Especially on Linux, crashing out of a networkzero process can leave the sockets\n lingering and unable to re-bind on startup. We give it a few goes here to see if\n we can bind within a couple of seconds.\n \"\"\"\n n_tries_left = n_tries\n while n_tries_left > 0:\n try:\n return bind_function(*args)\n except zmq.error.ZMQError as exc:\n _logger.warn(\"%s; %d tries remaining\", exc, n_tries_left)\n n_tries_left -= 1\n except OSError as exc:\n if exc.errno == errno.EADDRINUSE:\n _logger.warn(\"%s; %d tries remaining\", exc, n_tries_left)\n n_tries_left -= 1\n else:\n raise\n else:\n raise core.SocketAlreadyExistsError(\"Failed to bind after %s tries\" % n_tries)", "metadata": "root._bind_with_timeout", "header": "['module', '___EOS___']", "index": 76 }, { "content": "class _Service(object):\n \"\"\"Convenience container with details of a service to be advertised\n \n Includes the name, address and when it is next due to be advertised\n \"\"\"\n \n ", "metadata": "root._Service", "header": "['module', '___EOS___']", "index": 99 }, { "content": " def __init__(self, name, address):\n self.name = name\n self.address = address\n self.advertise_at = 0", "metadata": "root._Service.__init__", "header": "['class', '_Service', '(', 'object', ')', ':', '___EOS___']", "index": 105 }, { "content": " def __str__(self):\n return \"_Service %s at %s due to advertise at %s\" % (self.name, self.address, time.ctime(self.advertise_at))", "metadata": "root._Service.__str__", "header": "['class', '_Service', '(', 'object', ')', ':', '___EOS___']", "index": 110 }, { "content": "class _Command(object):\n \"\"\"Convenience container with details of a running command\n \n Includes the action (\"discover\", \"advertise\" etc.), its parameters, when\n it was started -- for timeout purposes -- and any response.\n \n This is used by the process_command functionality\n \"\"\"\n \n", "metadata": "root._Command", "header": "['module', '___EOS___']", "index": 113 }, { "content": " def __init__(self, action, params):\n self.action = action\n self.params = params\n self.started_at = time.time()\n self.response = Empty", "metadata": "root._Command.__init__", "header": "['class', '_Command', '(', 'object', ')', ':', '___EOS___']", "index": 122 }, { "content": " def __str__(self):\n return \"_Command: %s (%s) started at %s -> %s\" % (self.action, self.params, time.ctime(self.started_at), self.response) ", "metadata": "root._Command.__str__", "header": "['class', '_Command', '(', 'object', ')', ':', '___EOS___']", "index": 128 }, { "content": "class _Beacon(threading.Thread):\n \"\"\"Threaded beacon to: listen for adverts & broadcast adverts\n \"\"\"\n \n rpc_port = 9998\n beacon_port = 9999\n finder_timeout_s = 0.05\n beacon_message_size = 256\n time_between_broadcasts_s = config.BEACON_ADVERT_FREQUENCY_S\n \n\n\n #\n # Commands available via RPC are methods whose name starts with \"do_\"\n #\n \n \n \n \n \n\n\n\n\n ", "metadata": "root._Beacon", "header": "['module', '___EOS___']", "index": 131 }, { "content": " def __init__(self):\n threading.Thread.__init__(self)\n self.setDaemon(True)\n self._stop_event = threading.Event()\n \n #\n # Services we're advertising\n #\n self._services_to_advertise = collections.deque()\n #\n # Broadcast adverts which we've received (some of which will be our own)\n #\n self._services_found = {}\n \n #\n # _Command requests are collected on one queue\n # _Command responses are added to another\n #\n self._command = None\n \n #\n # Set the socket up to broadcast datagrams over UDP\n #\n self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)\n self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)\n self.socket.bind((\"\", self.beacon_port))\n #\n # Add the raw UDP socket to a ZeroMQ socket poller so we can check whether\n # it's received anything as part of the beacon's main event loop.\n #\n self.socket_fd = self.socket.fileno()\n self.poller = zmq.Poller()\n self.poller.register(self.socket, zmq.POLLIN)\n\n self.rpc = sockets.context.socket(zmq.REP)\n #\n # To avoid problems when restarting a beacon not long after it's been\n # closed, force the socket to shut down regardless about 1 second after \n # it's been closed.\n #\n _bind_with_timeout(self.rpc.bind, (\"tcp://127.0.0.1:%s\" % self.rpc_port,))", "metadata": "root._Beacon.__init__", "header": "['class', '_Beacon', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 141 }, { "content": " def stop(self):\n _logger.debug(\"About to stop\")\n self._stop_event.set()", "metadata": "root._Beacon.stop", "header": "['class', '_Beacon', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 183 }, { "content": " def do_advertise(self, started_at, name, address, fail_if_exists):\n _logger.debug(\"Advertise %s on %s %s\", name, address, fail_if_exists)\n canonical_address = core.address(address)\n \n for service in self._services_to_advertise:\n if service.name == name:\n if fail_if_exists:\n _logger.error(\"_Service %s already exists on %s\", name, service.address)\n return None\n else:\n _logger.warn(\"Superseding service %s which already exists on %s\", name, service.address)\n\n self._services_to_advertise.append(_Service(name, canonical_address))\n #\n # As a shortcut, automatically \"discover\" any services we ourselves are advertising\n #\n self._services_found[name] = canonical_address\n \n return canonical_address", "metadata": "root._Beacon.do_advertise", "header": "['class', '_Beacon', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 190 }, { "content": " def do_discover(self, started_at, name, wait_for_s):\n _logger.debug(\"Discover %s waiting for %s seconds\", name, wait_for_s)\n \n discovered = self._services_found.get(name)\n\n #\n # If we've got a match, return it. Otherwise:\n # * If we're due to wait for ever, continue\n # * If we're out of time return None\n # * Otherwise we've still got time left: continue\n #\n if discovered:\n return discovered\n \n if timed_out(started_at, wait_for_s):\n return None\n else:\n return Continue", "metadata": "root._Beacon.do_discover", "header": "['class', '_Beacon', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 210 }, { "content": " def do_discover_all(self, started_at):\n _logger.debug(\"Discover all\")\n return list(self._services_found.items())", "metadata": "root._Beacon.do_discover_all", "header": "['class', '_Beacon', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 229 }, { "content": " def do_reset(self, started_at):\n _logger.debug(\"Reset\")\n self._services_found.clear()\n self._services_to_advertise.clear()", "metadata": "root._Beacon.do_reset", "header": "['class', '_Beacon', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 233 }, { "content": " def do_stop(self, started_at):\n _logger.debug(\"Stop\")\n self.stop()", "metadata": "root._Beacon.do_stop", "header": "['class', '_Beacon', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 238 }, { "content": " def listen_for_one_advert(self):\n events = dict(self.poller.poll(1000 * self.finder_timeout_s))\n if self.socket_fd not in events: \n return\n\n message, source = self.socket.recvfrom(self.beacon_message_size)\n service_name, service_address = _unpack(message)\n self._services_found[service_name] = service_address", "metadata": "root._Beacon.listen_for_one_advert", "header": "['class', '_Beacon', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 242 }, { "content": " def broadcast_one_advert(self):\n if self._services_to_advertise:\n next_service = self._services_to_advertise[0]\n if next_service.advertise_at < time.time():\n message = _pack([next_service.name, next_service.address])\n self.socket.sendto(message, 0, (\"255.255.255.255\", self.beacon_port))\n next_service.advertise_at = time.time() + self.time_between_broadcasts_s\n self._services_to_advertise.rotate(-1)", "metadata": "root._Beacon.broadcast_one_advert", "header": "['class', '_Beacon', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 251 }, { "content": " def poll_command_request(self):\n \"\"\"If the command RPC socket has an incoming request,\n separate it into its action and its params and put it\n on the command request queue.\n \"\"\"\n try:\n message = self.rpc.recv(zmq.NOBLOCK)\n except zmq.ZMQError as exc:\n if exc.errno == zmq.EAGAIN:\n return\n else:\n raise\n\n _logger.debug(\"Received command %s\", message)\n segments = _unpack(message)\n action, params = segments[0], segments[1:]\n _logger.debug(\"Adding %s, %s to the request queue\", action, params)\n self._command = _Command(action, params)", "metadata": "root._Beacon.poll_command_request", "header": "['class', '_Beacon', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 260 }, { "content": " def process_command(self):\n if not self._command:\n return\n else:\n _logger.debug(\"process_command: %s\", self._command.action)\n command = self._command\n\n _logger.debug(\"Picked %s, %s, %s\", self._command.action, self._command.params, self._command.started_at)\n function = getattr(self, \"do_\" + command.action.lower(), None)\n if not function:\n raise NotImplementedError(\"%s is not a valid action\")\n else:\n try:\n result = function(command.started_at, *command.params)\n except:\n _logger.exception(\"Problem calling %s with %s\", command.action, command.params)\n result = None\n \n _logger.debug(\"result = %s\", result)\n \n #\n # result will be Continue if the action cannot be completed\n # (eg a discovery) but its time is not yet expired. Leave\n # the command on the stack for now.\n #\n if result is Continue:\n return\n \n #\n # If we get a result, add the result to the response\n # queue and pop the request off the stack.\n #\n self._command.response = result", "metadata": "root._Beacon.process_command", "header": "['class', '_Beacon', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 279 }, { "content": " def poll_command_reponse(self):\n \"\"\"If the latest request has a response, issue it as a\n reply to the RPC socket.\n \"\"\"\n if self._command.response is not Empty:\n _logger.debug(\"Sending response %s\", self._command.response)\n self.rpc.send(_pack(self._command.response))\n self._command = None", "metadata": "root._Beacon.poll_command_reponse", "header": "['class', '_Beacon', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 313 }, { "content": " def run(self):\n _logger.info(\"Starting discovery\")\n while not self._stop_event.wait(0):\n \n try:\n #\n # If we're not already processing one, check for an command\n # to advertise/discover from a local process.\n #\n if not self._command:\n self.poll_command_request()\n \n #\n # Broadcast the first advert whose advertising schedule\n # has arrived\n #\n self.broadcast_one_advert()\n \n #\n # See if an advert broadcast has arrived\n #\n self.listen_for_one_advert()\n \n #\n # If we're processing a command, see if it's complete\n #\n if self._command:\n self.process_command()\n self.poll_command_reponse()\n\n except:\n _logger.exception(\"Problem in beacon thread\")\n break\n \n _logger.info(\"Ending discovery\")\n self.rpc.close()\n self.socket.close()", "metadata": "root._Beacon.run", "header": "['class', '_Beacon', '(', 'threading', '.', 'Thread', ')', ':', '___EOS___']", "index": 322 }, { "content": "def _start_beacon():\n \"\"\"Start a beacon thread within this process if no beacon is currently\n running on this machine.\n \n In general this is called automatically when an attempt is made to\n advertise or discover. It might be convenient, though, to call this\n function directly if you want to have a process whose only job is\n to host this beacon so that it doesn't shut down when other processes\n shut down.\n \"\"\"\n global _beacon\n if _beacon is None:\n _logger.debug(\"About to start beacon\")\n try:\n _beacon = _Beacon()\n except OSError as exc:\n if exc.errno == errno.EADDRINUSE:\n _logger.warn(\"Beacon already active on this machine\")\n #\n # _remote_beacon is simply a not-None sentinel value\n # to distinguish between the case where we have not\n # yet started a beacon and where we have found one\n # in another process.\n #\n _beacon = _remote_beacon\n else:\n raise\n else:\n _beacon.start()", "metadata": "root._start_beacon", "header": "['module', '___EOS___']", "index": 363 }, { "content": "def _rpc(action, *args):\n _logger.debug(\"About to send rpc request %s with args %s\", action, args)\n with sockets.context.socket(zmq.REQ) as socket:\n #\n # To avoid problems when restarting a beacon not long after it's been\n # closed, force the socket to shut down regardless about 1 second after \n # it's been closed.\n #\n socket.connect(\"tcp://localhost:%s\" % _Beacon.rpc_port)\n socket.send(_pack([action] + list(args)))\n return _unpack(socket.recv())", "metadata": "root._rpc", "header": "['module', '___EOS___']", "index": 393 }, { "content": "def advertise(name, address=None, fail_if_exists=False):\n \"\"\"Advertise a name at an address\n \n Start to advertise service `name` at address `address`. If\n the address is not supplied, one is constructed and this is\n returned by the function. ie this is a typical use::\n \n address = nw0.advertise(\"myservice\")\n \n :param name: any text\n :param address: either \"ip:port\" or None\n :param fail_if_exists: fail if this name is already registered?\n :returns: the address given or constructed\n \"\"\"\n _start_beacon()\n return _rpc(\"advertise\", name, address, fail_if_exists)\n return address", "metadata": "root.advertise", "header": "['module', '___EOS___']", "index": 405 }, { "content": "def discover(name, wait_for_s=60):\n \"\"\"Discover a service by name\n \n Look for an advert to a named service::\n \n address = nw0.discover(\"myservice\")\n \n :param name: any text\n :param wait_for_s: how many seconds to wait before giving up\n :returns: the address found or None\n \"\"\"\n _start_beacon()\n #\n # It's possible to enter a deadlock situation where the first\n # process fires off a discovery request and waits for the\n # second process to advertise. But the second process has to\n # connect to the rpc port of the first process' beacon and\n # its advertisement is queued behind the pending discovery.\n #\n # To give both a chance of succeeding we operate in bursts,\n # allowing them to interleave.\n #\n t0 = time.time()\n while True:\n discovery = _rpc(\"discover\", name, 0.5)\n if discovery:\n return discovery\n if timed_out(t0, wait_for_s):\n return None", "metadata": "root.discover", "header": "['module', '___EOS___']", "index": 423 }, { "content": "def discover_all():\n \"\"\"Produce a list of all known services and their addresses\n \n Ask for all known services as a list of 2-tuples: (name, address)\n This could, eg, be used to form a dictionary of services::\n \n services = dict(nw0.discover_all())\n \n :returns: a list of 2-tuples [(name, address), ...]\n \"\"\"\n _start_beacon()\n return _rpc(\"discover_all\")", "metadata": "root.discover_all", "header": "['module', '___EOS___']", "index": 453 }, { "content": "def discover_group(group, exclude=None):\n \"\"\"Produce a list of all services and their addresses in a group\n \n A group is an optional form of namespace within the discovery mechanism.\n If an advertised name has the form <group>/<name> it is deemed to\n belong to <group>. Note that the service's name is still the full\n string <group>/<name>. The group concept is simply for discovery and\n to assist differentiation, eg, in a classroom group.\n \n :param group: the name of a group prefix\n :param exclude: an iterable of names to exclude (or None)\n \n :returns: a list of 2-tuples [(name, address), ...]\n \"\"\"\n _start_beacon()\n if exclude is None:\n names_to_exclude = set()\n else:\n names_to_exclude = set(exclude)\n all_discovered = _rpc(\"discover_all\")\n return [(name, address) \n for (name, address) in all_discovered \n if name.startswith(\"%s/\" % group)\n and name not in names_to_exclude\n ]", "metadata": "root.discover_group", "header": "['module', '___EOS___']", "index": 466 }, { "content": "def reset_beacon():\n \"\"\"Clear the adverts which the beacon is carrying\n \n (This is mostly useful when testing, to get a fresh start)\n \"\"\"\n _start_beacon()\n return _rpc(\"reset\")", "metadata": "root.reset_beacon", "header": "['module', '___EOS___']", "index": 492 } ]
[ { "span": "import os, sys", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 14 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "Advert", "ise", " ", "and", " ", "collect", " ", "advertise", "ment", "s", " ", "of", " ", "network", " ", "service", "s", "\\", "10", ";", "\\", "10", ";", "The", " ", "discove", "ry", " ", "module", " ", "offers", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "A", " ", "UD", "P", " ", "broadcast", " ", "socket", " ", "whi", "ch", ":", "\\", "10", ";", " ", " ", "\\", "10", ";", " ", " ", "-", " ", "Listen", "s", " ", "for", " ", "and", " ", "keep", "s", " ", "track", " ", "of", " ", "service", " ", "adver", "ts", " ", "from", " ", "this", " ", "and", " ", "other", " ", "\\", "10", ";", " ", " ", " ", " ", "machine", "s", " ", "&", " ", "process", "es", "\\", "10", ";", " ", " ", "-", " ", "Broad", "cast", "s", " ", "service", "s", " ", "advertise", "d", " ", "by", " ", "this", " ", "process", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "*", " ", "A", " ", "Zero", "MQ", " ", "socket", " ", "whi", "ch", " ", "allow", " ", "any", " ", "process", " ", "on", " ", "this", " ", "machine", " ", "to", " ", "\\", "10", ";", " ", " ", "communi", "cate", " ", "with", " ", "its", " ", "broadcast", " ", "socket", "\\", "10", ";", "\\", "10", ";", "In", " ", "other", " ", "words", ",", " ", "we", " ", "have", " ", "a", " ", "beacon", " ", "whi", "ch", " ", "listen", "s", " ", "to", " ", "instruct", "ion", "s", "\\", "10", ";", "from", " ", "process", "es", " ", "on", " ", "this", " ", "machine", " ", "whi", "le", " ", "sendin", "g", " ", "out", " ", "and", " ", "listen", "ing", " ", "\\", "10", ";", "to", " ", "adver", "ts", " ", "broadcast", " ", "to", "/", "from", " ", "all", " ", "machine", "s", " ", "on", " ", "the", " ", "network", ".", "\\", "10", ";", "\\", "10", ";", "The", " ", "beacon", " ", "is", " ", "start", "ed", " ", "automati", "call", "y", " ", "in", " ", "a", " ", "daemon", " ", "thread", " ", "whe", "n", " ", "the", " ", "first", " ", "\\", "10", ";", "atte", "mpt", " ", "is", " ", "made", " ", "to", " ", "advertise", " ", "or", " ", "discove", "r", ".", " ", "If", " ", "anot", "her", " ", "process", " ", "alr", "ead", "y", " ", "\\", "10", ";", "has", " ", "a", " ", "beacon", " ", "runn", "ing", " ", "(", "ie", " ", "if", " ", "this", " ", "beacon", " ", "can", "'", "t", " ", "bind", " ", "to", " ", "its", " ", "port", ")", " ", "this", " ", "\\", "10", ";", "beacon", " ", "thread", " ", "will", " ", "shut", " ", "down", " ", "with", " ", "no", " ", "fur", "ther", " ", "action", ".", "\\", "10", ";", "\\", "10", ";", "The", " ", "module", "-", "level", " ", "function", "s", " ", "to", " ", "advertise", " ", "and", " ", "discove", "r", " ", "will", " ", "open", " ", "a", " ", "connecti", "on", "\\", "10", ";", "to", " ", "a", " ", "Zero", "MQ", " ", "socket", " ", "on", " ", "this", " ", "machine", " ", "(", "whi", "ch", " ", "mig", "ht", " ", "be", " ", "hoste", "d", " ", "by", " ", "this", " ", "or", " ", "by", " ", "anot", "her", "\\", "10", ";", "process", ")", " ", "and", " ", "will", " ", "use", " ", "this", " ", "socket", " ", "to", " ", "send", " ", "command", "s", " ", "to", " ", "the", " ", "beacon", " ", "thread", " ", "whi", "ch", "\\", "10", ";", "will", " ", "update", " ", "or", " ", "return", " ", "its", " ", "internal", " ", "list", " ", "of", " ", "advertise", "d", " ", "service", "s", ".", "\\", "10", ";", "\\", "10", ";", "As", " ", "an", " ", "addition", "al", " ", "convenien", "ce", ",", " ", "the", " ", ":", "func", ":`", "advertise", "`", " ", "function", " ", "will", ",", " ", "if", " ", "give", "n", " ", "no", "\\", "10", ";", "specific", " ", "address", ",", " ", "generat", "e", " ", "a", " ", "suit", "able", " ", "ip", ":", "port", " ", "pair", " ", "by", " ", "inter", "rog", "ati", "ng", " ", "the", " ", "system", ".", "\\", "10", ";", "Thi", "s", " ", "functional", "it", "y", " ", "is", " ", "actual", "ly", " ", "in", " ", ":", "func", ":`", "core", ".", "address", "`", " ", "(", "qv", ").", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", ",_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "errno_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "threading_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "zmq_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "import_", "config_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "import_", "core_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "import_", "sockets_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "logger_", "=_", "core_", "._", "get", "\\u", "logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Continu", "e", " ", "is", " ", "a", " ", "sentinel", " ", "value", " ", "to", " ", "indicat", "e", " ", "tha", "t", " ", "a", " ", "command_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "has", " ", "complete", "d", " ", "its", " ", "schedule", "d", " ", "slice", " ", "with", "out", " ", "produc", "ing", " ", "a", " ", "result_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "with", "out", " ", "exceed", "ing", " ", "its", " ", "over", "all", " ", "timeo", "ut", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "Continu", "e_", "=_", "object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Emp", "ty", " ", "is", " ", "a", " ", "sentinel", " ", "to", " ", "distinguish", " ", "bet", "ween", " ", "no", " ", "result", " ", "and", " ", "a", " ", "result", " ", "of", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "Empty_", "=_", "object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "beacon", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "remote", "\\u", "beacon", "_", "=_", "object_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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 ", " _", "\\u", "start", "\\u", "beacon", "_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "unpack_", "(_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "json_", "._", "loads_", "(_", "message_", "._", "decode_", "(_", "config_", "._", "ENCODING_", ")_", ")_", "\\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", "pack_", "(_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "json_", "._", "dumps_", "(_", "message_", ")_", "._", "encode_", "(_", "config_", "._", "ENCODING_", ")_", "\\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_", "timed", "\\u", "out_", "(_", "start", "ed", "\\u", "at_", ",_", "wait", "\\u", "for", "\\u", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "the", " ", "wait", " ", "time", " ", "is", " ", "the", " ", "sentinel", " ", "value", " ", "FORE", "VER", ",", " ", "neve", "r", " ", "time", " ", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ot", "her", "wis", "e", " ", "time", " ", "out", " ", "if", " ", "the", " ", "current", " ", "time", " ", "is", " ", "more", " ", "than", " ", "wait", "\\u", "for", "\\u", "s", " ", "second", "s", " ", "after", " ", "the", " ", "start", " ", "time_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "wait", "\\u", "for", "\\u", "s_", "is_", "config_", "._", "FORE", "VER_", ":_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "time_", "._", "time_", "(_", ")_", ">_", "start", "ed", "\\u", "at_", "+_", "wait", "\\u", "for", "\\u", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "bind", "\\u", "with", "\\u", "timeout_", "(_", "bind", "\\u", "function_", ",_", "args_", ",_", "n", "\\u", "tries_", "=_", "3_", ",_", "retr", "y", "\\u", "interval", "\\u", "s_", "=_", "0.5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Atte", "mpt", " ", "to", " ", "bind", " ", "a", " ", "socket", " ", "a", " ", "number", " ", "of", " ", "times", " ", "with", " ", "a", " ", "short", " ", "interval", " ", "in", " ", "bet", "ween", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Espe", "cia", "ll", "y", " ", "on", " ", "Lin", "ux", ",", " ", "crash", "ing", " ", "out", " ", "of", " ", "a", " ", "network", "zero", " ", "process", " ", "can", " ", "lea", "ve", " ", "the", " ", "socket", "s", "\\", "10", ";", " ", " ", " ", " ", "ling", "erin", "g", " ", "and", " ", "una", "ble", " ", "to", " ", "re", "-", "bind", " ", "on", " ", "start", "up", ".", " ", "We", " ", "give", " ", "it", " ", "a", " ", "few", " ", "go", "es", " ", "here", " ", "to", " ", "see", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "we", " ", "can", " ", "bind", " ", "within", " ", "a", " ", "couple", " ", "of", " ", "second", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "trie", "s", "\\u", "left_", "=_", "n", "\\u", "tries_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "n", "\\u", "trie", "s", "\\u", "left_", ">_", "0_", ":_", "\\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_", "bind", "\\u", "function_", "(_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zmq_", "._", "error_", "._", "ZM", "QE", "rror_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "warn_", "(_", "\"%", "s", ";", " ", "%", "d", " ", "trie", "s", " ", "rema", "inin", "g", "\"_", ",_", "exc_", ",_", "n", "\\u", "trie", "s", "\\u", "left_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "trie", "s", "\\u", "left_", "-=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "OSE", "rror_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "exc_", "._", "errno_", "==_", "errno_", "._", "EAD", "DRI", "NU", "SE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "warn_", "(_", "\"%", "s", ";", " ", "%", "d", " ", "trie", "s", " ", "rema", "inin", "g", "\"_", ",_", "exc_", ",_", "n", "\\u", "trie", "s", "\\u", "left_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n", "\\u", "trie", "s", "\\u", "left_", "-=_", "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 ", " _", "raise_", "\\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 ", " _", "raise_", "core_", "._", "Sock", "et", "Al", "read", "y", "Exist", "s", "Error_", "(_", "\"", "Fail", "ed", " ", "to", " ", "bind", " ", "after", " ", "%", "s", " ", "trie", "s", "\"_", "%_", "n", "\\u", "tries_", ")_", "\\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_", "\\u", "Service_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Conve", "nie", "nce", " ", "container", " ", "with", " ", "deta", "il", "s", " ", "of", " ", "a", " ", "service", " ", "to", " ", "be", " ", "advertise", "d", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Includes", " ", "the", " ", "name", ",", " ", "address", " ", "and", " ", "whe", "n", " ", "it", " ", "is", " ", "next", " ", "due", " ", "to", " ", "be", " ", "advertise", "d", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Service_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "name_", ",_", "address_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "name_", "=_", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "address_", "=_", "address_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "advertise", "\\u", "at_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Service_", "(_", "object_", ")_", ":_", "\\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_", "\"\\u", "Service", " ", "%", "s", " ", "at", " ", "%", "s", " ", "due", " ", "to", " ", "advertise", " ", "at", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "name_", ",_", "self_", "._", "address_", ",_", "time_", "._", "ctime_", "(_", "self_", "._", "advertise", "\\u", "at_", ")_", ")_", "\\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_", "\\u", "Command_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Conve", "nie", "nce", " ", "container", " ", "with", " ", "deta", "il", "s", " ", "of", " ", "a", " ", "runn", "ing", " ", "command", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Includes", " ", "the", " ", "action", " ", "(\"", "discove", "r", "\",", " ", "\"", "advertise", "\"", " ", "etc", ".)", ",", " ", "its", " ", "parameter", "s", ",", " ", "whe", "n", "\\", "10", ";", " ", " ", " ", " ", "it", " ", "was", " ", "start", "ed", " ", "--", " ", "for", " ", "timeo", "ut", " ", "purpose", "s", " ", "--", " ", "and", " ", "any", " ", "response", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "is", " ", "used", " ", "by", " ", "the", " ", "process", "\\u", "command", " ", "functional", "it", "y", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Command_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "action_", ",_", "params_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "action_", "=_", "action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "params_", "=_", "params_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "start", "ed", "\\u", "at_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "response_", "=_", "Empty_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Command_", "(_", "object_", ")_", ":_", "\\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_", "\"\\u", "Command", ":", " ", "%", "s", " ", "(%", "s", ")", " ", "start", "ed", " ", "at", " ", "%", "s", " ", "->", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "action_", ",_", "self_", "._", "params_", ",_", "time_", "._", "ctime_", "(_", "self_", "._", "start", "ed", "\\u", "at_", ")_", ",_", "self_", "._", "response_", ")_", "\\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_", "\\u", "Bea", "con_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Thread", "ed", " ", "beacon", " ", "to", ":", " ", "listen", " ", "for", " ", "adver", "ts", " ", "&", " ", "broadcast", " ", "adver", "ts", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rpc", "\\u", "port_", "=_", "9998", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "beacon", "\\u", "port_", "=_", "9999_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "finde", "r", "\\u", "timeo", "ut", "\\u", "s_", "=_", "0.05_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "beacon", "\\u", "message", "\\u", "size_", "=_", "256_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "bet", "ween", "\\u", "broadcast", "s", "\\u", "s_", "=_", "config_", "._", "BEA", "CON", "\\u", "ADV", "ERT", "\\u", "FREQUENCY", "\\u", "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\\uNL\\u\\u\\u_", "#", " ", "Command", "s", " ", "avail", "able", " ", "via", " ", "RP", "C", " ", "are", " ", "method", "s", " ", "who", "se", " ", "name", " ", "starts", " ", "with", " ", "\"", "do", "\\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_", "\\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_", "\\u", "Bea", "con_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "threading_", "._", "Thread_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Daemon_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "stop", "\\u", "event_", "=_", "threading_", "._", "Event_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Service", "s", " ", "we", "'", "re", " ", "adver", "tis", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "service", "s", "\\u", "to", "\\u", "advertise", "_", "=_", "collections_", "._", "deque_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Broad", "cast", " ", "adver", "ts", " ", "whi", "ch", " ", "we", "'", "ve", " ", "receive", "d", " ", "(", "some", " ", "of", " ", "whi", "ch", " ", "will", " ", "be", " ", "our", " ", "own", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "service", "s", "\\u", "found_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\\u", "Command", " ", "request", "s", " ", "are", " ", "collected", " ", "on", " ", "one", " ", "queue_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\\u", "Command", " ", "response", "s", " ", "are", " ", "adde", "d", " ", "to", " ", "anot", "her_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "command_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Set", " ", "the", " ", "socket", " ", "up", " ", "to", " ", "broadcast", " ", "datagram", "s", " ", "over", " ", "UDP_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "socket_", "=_", "socket_", "._", "socket_", "(_", "socket_", "._", "AF", "\\u", "INET_", ",_", "socket_", "._", "SOCK", "\\u", "DGRAM_", ",_", "socket_", "._", "IPP", "ROTO", "\\u", "UDP_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "socket_", "._", "setsockopt_", "(_", "socket_", "._", "SOL", "\\u", "SOCKET_", ",_", "socket_", "._", "SO", "\\u", "BROADCAST", "_", ",_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "socket_", "._", "bind_", "(_", "(_", "\"\"_", ",_", "self_", "._", "beacon", "\\u", "port_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "the", " ", "raw", " ", "UD", "P", " ", "socket", " ", "to", " ", "a", " ", "Zero", "MQ", " ", "socket", " ", "polle", "r", " ", "so", " ", "we", " ", "can", " ", "check", " ", "whe", "ther_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", "'", "s", " ", "receive", "d", " ", "anyt", "hing", " ", "as", " ", "part", " ", "of", " ", "the", " ", "beacon", "'", "s", " ", "main", " ", "event", " ", "loop", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "socket", "\\u", "fd_", "=_", "self_", "._", "socket_", "._", "fileno_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "poller_", "=_", "zmq_", "._", "Poller", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "poller_", "._", "register_", "(_", "self_", "._", "socket_", ",_", "zmq_", "._", "POLL", "IN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "rpc_", "=_", "sockets_", "._", "context_", "._", "socket_", "(_", "zmq_", "._", "REP", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "To", " ", "avoid", " ", "problem", "s", " ", "whe", "n", " ", "restart", "ing", " ", "a", " ", "beacon", " ", "not", " ", "long", " ", "after", " ", "it", "'", "s", " ", "bee", "n_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "close", "d", ",", " ", "force", " ", "the", " ", "socket", " ", "to", " ", "shut", " ", "down", " ", "rega", "rd", "less", " ", "abo", "ut", " ", "1", " ", "second", " ", "after", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", "'", "s", " ", "bee", "n", " ", "close", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "bind", "\\u", "with", "\\u", "timeout_", "(_", "self_", "._", "rpc_", "._", "bind_", ",_", "(_", "\"", "tcp", "://", "127", ".0", ".0", ".1", ":", "%", "s", "\"_", "%_", "self_", "._", "rpc", "\\u", "port_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Bea", "con_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\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_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "debug_", "(_", "\"", "Abo", "ut", " ", "to", " ", "stop", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "stop", "\\u", "event_", "._", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Bea", "con_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "advertise", "_", "(_", "self_", ",_", "start", "ed", "\\u", "at_", ",_", "name_", ",_", "address_", ",_", "fail", "\\u", "if", "\\u", "exists_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "debug_", "(_", "\"", "Advert", "ise", " ", "%", "s", " ", "on", " ", "%", "s", " ", "%", "s", "\"_", ",_", "name_", ",_", "address_", ",_", "fail", "\\u", "if", "\\u", "exists_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "canonical", "\\u", "address_", "=_", "core_", "._", "address_", "(_", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "service_", "in_", "self_", "._", "\\u", "service", "s", "\\u", "to", "\\u", "advertise", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "service_", "._", "name_", "==_", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "fail", "\\u", "if", "\\u", "exists_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "\\u", "logger_", "._", "error_", "(_", "\"\\u", "Service", " ", "%", "s", " ", "alr", "ead", "y", " ", "exist", "s", " ", "on", " ", "%", "s", "\"_", ",_", "name_", ",_", "service_", "._", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "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 ", " ", "_", "\\u", "logger_", "._", "warn_", "(_", "\"", "Super", "sed", "ing", " ", "service", " ", "%", "s", " ", "whi", "ch", " ", "alr", "ead", "y", " ", "exist", "s", " ", "on", " ", "%", "s", "\"_", ",_", "name_", ",_", "service_", "._", "address_", ")_", "\\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_", "self_", "._", "\\u", "service", "s", "\\u", "to", "\\u", "advertise", "_", "._", "append_", "(_", "\\u", "Service_", "(_", "name_", ",_", "canonical", "\\u", "address_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "As", " ", "a", " ", "shortcut", ",", " ", "automati", "call", "y", " ", "\"", "discove", "r", "\"", " ", "any", " ", "service", "s", " ", "we", " ", "ours", "elv", "es", " ", "are", " ", "adver", "tis", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "service", "s", "\\u", "found_", "[_", "name_", "]_", "=_", "canonical", "\\u", "address_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "canonical", "\\u", "address_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Bea", "con_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "discover_", "(_", "self_", ",_", "start", "ed", "\\u", "at_", ",_", "name_", ",_", "wait", "\\u", "for", "\\u", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "debug_", "(_", "\"", "Discover", " ", "%", "s", " ", "wait", "ing", " ", "for", " ", "%", "s", " ", "second", "s", "\"_", ",_", "name_", ",_", "wait", "\\u", "for", "\\u", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "discovere", "d_", "=_", "self_", "._", "\\u", "service", "s", "\\u", "found_", "._", "get_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", "'", "ve", " ", "got", " ", "a", " ", "match", ",", " ", "return", " ", "it", ".", " ", "Ot", "her", "wis", "e", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "If", " ", "we", "'", "re", " ", "due", " ", "to", " ", "wait", " ", "for", " ", "ever", ",", " ", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "If", " ", "we", "'", "re", " ", "out", " ", "of", " ", "time", " ", "return", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "*", " ", "Ot", "her", "wis", "e", " ", "we", "'", "ve", " ", "still", " ", "got", " ", "time", " ", "left", ":", " ", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "discovere", "d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "discovere", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "timed", "\\u", "out_", "(_", "start", "ed", "\\u", "at_", ",_", "wait", "\\u", "for", "\\u", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Continu", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Bea", "con_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\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_", "do", "\\u", "discove", "r", "\\u", "all_", "(_", "self_", ",_", "start", "ed", "\\u", "at_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "debug_", "(_", "\"", "Discover", " ", "all", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "list_", "(_", "self_", "._", "\\u", "service", "s", "\\u", "found_", "._", "items_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Bea", "con_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "reset_", "(_", "self_", ",_", "start", "ed", "\\u", "at_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "debug_", "(_", "\"", "Reset", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "service", "s", "\\u", "found_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "service", "s", "\\u", "to", "\\u", "advertise", "_", "._", "clear_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Bea", "con_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "do", "\\u", "stop_", "(_", "self_", ",_", "start", "ed", "\\u", "at_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "debug_", "(_", "\"", "Sto", "p", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "stop_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Bea", "con_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "listen", "\\u", "for", "\\u", "one", "\\u", "adver", "t_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "events_", "=_", "dict_", "(_", "self_", "._", "poller_", "._", "poll_", "(_", "1000_", "*_", "self_", "._", "finde", "r", "\\u", "timeo", "ut", "\\u", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "socket", "\\u", "fd_", "not_", "in_", "events_", ":_", "\\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_", "message_", ",_", "source_", "=_", "self_", "._", "socket_", "._", "recv", "from_", "(_", "self_", "._", "beacon", "\\u", "message", "\\u", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "service", "\\u", "name_", ",_", "service", "\\u", "address_", "=_", "\\u", "unpack_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "service", "s", "\\u", "found_", "[_", "service", "\\u", "name_", "]_", "=_", "service", "\\u", "address_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Bea", "con_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "broadcast", "\\u", "one", "\\u", "adver", "t_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "service", "s", "\\u", "to", "\\u", "advertise", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "next", "\\u", "service_", "=_", "self_", "._", "\\u", "service", "s", "\\u", "to", "\\u", "advertise", "_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "next", "\\u", "service_", "._", "advertise", "\\u", "at_", "<_", "time_", "._", "time_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "message_", "=_", "\\u", "pack_", "(_", "[_", "next", "\\u", "service_", "._", "name_", ",_", "next", "\\u", "service_", "._", "address_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "socket_", "._", "sendto_", "(_", "message_", ",_", "0_", ",_", "(_", "\"", "255.", "255.", "255.", "255", "\"_", ",_", "self_", "._", "beacon", "\\u", "port_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "next", "\\u", "service_", "._", "advertise", "\\u", "at_", "=_", "time_", "._", "time_", "(_", ")_", "+_", "self_", "._", "time", "\\u", "bet", "ween", "\\u", "broadcast", "s", "\\u", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "service", "s", "\\u", "to", "\\u", "advertise", "_", "._", "rotate_", "(_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Bea", "con_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\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_", "poll", "\\u", "command", "\\u", "request_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "If", " ", "the", " ", "command", " ", "RP", "C", " ", "socket", " ", "has", " ", "an", " ", "inco", "ming", " ", "request", ",", "\\", "10", ";", " ", " ", " ", " ", "separate", " ", "it", " ", "int", "o", " ", "its", " ", "action", " ", "and", " ", "its", " ", "params", " ", "and", " ", "put", " ", "it", "\\", "10", ";", " ", " ", " ", " ", "on", " ", "the", " ", "command", " ", "request", " ", "queue", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "message_", "=_", "self_", "._", "rpc_", "._", "recv_", "(_", "zmq_", "._", "NO", "BLOCK_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "zmq_", "._", "ZM", "QE", "rror_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "exc_", "._", "errno_", "==_", "zmq_", "._", "EA", "GAIN", "_", ":_", "\\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 ", " _", "raise_", "\\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", "logger_", "._", "debug_", "(_", "\"", "Receive", "d", " ", "command", " ", "%", "s", "\"_", ",_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "segments_", "=_", "\\u", "unpack_", "(_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "action_", ",_", "params_", "=_", "segments_", "[_", "0_", "]_", ",_", "segments_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "logger_", "._", "debug_", "(_", "\"", "Add", "ing", " ", "%", "s", ",", " ", "%", "s", " ", "to", " ", "the", " ", "request", " ", "queue", "\"_", ",_", "action_", ",_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "command_", "=_", "\\u", "Command_", "(_", "action_", ",_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Bea", "con_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "process", "\\u", "command_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "command_", ":_", "\\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 ", " _", "\\u", "logger_", "._", "debug_", "(_", "\"", "process", "\\u", "command", ":", " ", "%", "s", "\"_", ",_", "self_", "._", "\\u", "command_", "._", "action_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "command_", "=_", "self_", "._", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "logger_", "._", "debug_", "(_", "\"", "Picke", "d", " ", "%", "s", ",", " ", "%", "s", ",", " ", "%", "s", "\"_", ",_", "self_", "._", "\\u", "command_", "._", "action_", ",_", "self_", "._", "\\u", "command_", "._", "params_", ",_", "self_", "._", "\\u", "command_", "._", "start", "ed", "\\u", "at_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "function_", "=_", "getattr_", "(_", "self_", ",_", "\"", "do", "\\u\"_", "+_", "command_", "._", "action_", "._", "lower_", "(_", ")_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "function_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\"%", "s", " ", "is", " ", "not", " ", "a", " ", "valid", " ", "action", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "function_", "(_", "command_", "._", "start", "ed", "\\u", "at_", ",_", "*_", "command_", "._", "params_", ")_", "\\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", "logger_", "._", "exception_", "(_", "\"", "Prob", "lem", " ", "calling", " ", "%", "s", " ", "with", " ", "%", "s", "\"_", ",_", "command_", "._", "action_", ",_", "command_", "._", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "logger_", "._", "debug_", "(_", "\"", "result", " ", "=", " ", "%", "s", "\"_", ",_", "result_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "result", " ", "will", " ", "be", " ", "Continu", "e", " ", "if", " ", "the", " ", "action", " ", "cann", "ot", " ", "be", " ", "completed_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "eg", " ", "a", " ", "discove", "ry", ")", " ", "but", " ", "its", " ", "time", " ", "is", " ", "not", " ", "ye", "t", " ", "expir", "ed", ".", " ", "Leav", "e_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "command", " ", "on", " ", "the", " ", "stack", " ", "for", " ", "now", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "result_", "is_", "Continu", "e_", ":_", "\\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\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "get", " ", "a", " ", "result", ",", " ", "add", " ", "the", " ", "result", " ", "to", " ", "the", " ", "response_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "queue", " ", "and", " ", "pop", " ", "the", " ", "request", " ", "off", " ", "the", " ", "stack", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "command_", "._", "response_", "=_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Bea", "con_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\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_", "poll", "\\u", "command", "\\u", "repon", "se_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "If", " ", "the", " ", "late", "st", " ", "request", " ", "has", " ", "a", " ", "response", ",", " ", "issue", " ", "it", " ", "as", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "repl", "y", " ", "to", " ", "the", " ", "RP", "C", " ", "socket", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "\\u", "command_", "._", "response_", "is_", "not_", "Empty_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "debug_", "(_", "\"", "Sen", "ding", " ", "response", " ", "%", "s", "\"_", ",_", "self_", "._", "\\u", "command_", "._", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rpc_", "._", "send_", "(_", "\\u", "pack_", "(_", "self_", "._", "\\u", "command_", "._", "response_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "command_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "\\u", "Bea", "con_", "(_", "threading_", "._", "Thread_", ")_", ":_", "\\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_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "info_", "(_", "\"", "Start", "ing", " ", "discove", "ry", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "not_", "self_", "._", "\\u", "stop", "\\u", "event_", "._", "wait_", "(_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", "'", "re", " ", "not", " ", "alr", "ead", "y", " ", "process", "ing", " ", "one", ",", " ", "check", " ", "for", " ", "an", " ", "command_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "advertise", "/", "discove", "r", " ", "from", " ", "a", " ", "local", " ", "process", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "command_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "poll", "\\u", "command", "\\u", "request_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Broad", "cast", " ", "the", " ", "first", " ", "adver", "t", " ", "who", "se", " ", "adver", "tis", "ing", " ", "schedule_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "has", " ", "arrive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "broadcast", "\\u", "one", "\\u", "adver", "t_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "See", " ", "if", " ", "an", " ", "adver", "t", " ", "broadcast", " ", "has", " ", "arrive", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "listen", "\\u", "for", "\\u", "one", "\\u", "adver", "t_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", "'", "re", " ", "process", "ing", " ", "a", " ", "command", ",", " ", "see", " ", "if", " ", "it", "'", "s", " ", "complete_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "\\u", "command_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "process", "\\u", "command_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "poll", "\\u", "command", "\\u", "repon", "se_", "(_", ")_", "\\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_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "exception_", "(_", "\"", "Prob", "lem", " ", "in", " ", "beacon", " ", "thread", "\"_", ")_", "\\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_", "\\u", "logger_", "._", "info_", "(_", "\"", "Endi", "ng", " ", "discove", "ry", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "rpc_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "socket_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "start", "\\u", "beacon", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Start", " ", "a", " ", "beacon", " ", "thread", " ", "within", " ", "this", " ", "process", " ", "if", " ", "no", " ", "beacon", " ", "is", " ", "currentl", "y", "\\", "10", ";", " ", " ", " ", " ", "runn", "ing", " ", "on", " ", "this", " ", "machine", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "In", " ", "genera", "l", " ", "this", " ", "is", " ", "call", "ed", " ", "automati", "call", "y", " ", "whe", "n", " ", "an", " ", "atte", "mpt", " ", "is", " ", "made", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "advertise", " ", "or", " ", "discove", "r", ".", " ", "It", " ", "mig", "ht", " ", "be", " ", "convenien", "t", ",", " ", "tho", "ugh", ",", " ", "to", " ", "call", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "function", " ", "direct", "ly", " ", "if", " ", "you", " ", "want", " ", "to", " ", "have", " ", "a", " ", "process", " ", "who", "se", " ", "only", " ", "job", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "host", " ", "this", " ", "beacon", " ", "so", " ", "tha", "t", " ", "it", " ", "doe", "sn", "'", "t", " ", "shut", " ", "down", " ", "whe", "n", " ", "other", " ", "process", "es", "\\", "10", ";", " ", " ", " ", " ", "shut", " ", "down", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "\\u", "beacon", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "\\u", "beacon", "_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "debug_", "(_", "\"", "Abo", "ut", " ", "to", " ", "start", " ", "beacon", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "beacon", "_", "=_", "\\u", "Bea", "con_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "OSE", "rror_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "exc_", "._", "errno_", "==_", "errno_", "._", "EAD", "DRI", "NU", "SE_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "warn_", "(_", "\"", "Bea", "con", " ", "alr", "ead", "y", " ", "active", " ", "on", " ", "this", " ", "machine", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\\u", "remote", "\\u", "beacon", " ", "is", " ", "simp", "ly", " ", "a", " ", "not", "-", "Non", "e", " ", "sentinel", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "distinguish", " ", "bet", "ween", " ", "the", " ", "case", " ", "where", " ", "we", " ", "have", " ", "not_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ye", "t", " ", "start", "ed", " ", "a", " ", "beacon", " ", "and", " ", "where", " ", "we", " ", "have", " ", "found", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "anot", "her", " ", "process", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "beacon", "_", "=_", "\\u", "remote", "\\u", "beacon", "_", "\\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_", "\\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 ", " _", "\\u", "beacon", "_", "._", "start_", "(_", ")_", "\\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_", "\\u", "rpc_", "(_", "action_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "debug_", "(_", "\"", "Abo", "ut", " ", "to", " ", "send", " ", "rpc", " ", "request", " ", "%", "s", " ", "with", " ", "args", " ", "%", "s", "\"_", ",_", "action_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "sockets_", "._", "context_", "._", "socket_", "(_", "zmq_", "._", "REQ_", ")_", "as_", "socket_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "To", " ", "avoid", " ", "problem", "s", " ", "whe", "n", " ", "restart", "ing", " ", "a", " ", "beacon", " ", "not", " ", "long", " ", "after", " ", "it", "'", "s", " ", "bee", "n_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "close", "d", ",", " ", "force", " ", "the", " ", "socket", " ", "to", " ", "shut", " ", "down", " ", "rega", "rd", "less", " ", "abo", "ut", " ", "1", " ", "second", " ", "after", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "it", "'", "s", " ", "bee", "n", " ", "close", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "socket_", "._", "connect_", "(_", "\"", "tcp", "://", "local", "host", ":", "%", "s", "\"_", "%_", "\\u", "Bea", "con_", "._", "rpc", "\\u", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "socket_", "._", "send_", "(_", "\\u", "pack_", "(_", "[_", "action_", "]_", "+_", "list_", "(_", "args_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u", "unpack_", "(_", "socket_", "._", "recv_", "(_", ")_", ")_", "\\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_", "advertise", "_", "(_", "name_", ",_", "address_", "=_", "None_", ",_", "fail", "\\u", "if", "\\u", "exists_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Advert", "ise", " ", "a", " ", "name", " ", "at", " ", "an", " ", "address", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Start", " ", "to", " ", "advertise", " ", "service", " ", "`", "name", "`", " ", "at", " ", "address", " ", "`", "address", "`.", " ", "If", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "address", " ", "is", " ", "not", " ", "supplie", "d", ",", " ", "one", " ", "is", " ", "construct", "ed", " ", "and", " ", "this", " ", "is", "\\", "10", ";", " ", " ", " ", " ", "return", "ed", " ", "by", " ", "the", " ", "function", ".", " ", "ie", " ", "this", " ", "is", " ", "a", " ", "typical", " ", "use", "::", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "address", " ", "=", " ", "nw", "0.", "advertise", "(\"", "myse", "rvice", "\")", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "name", ":", " ", "any", " ", "text", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "address", ":", " ", "eit", "her", " ", "\"", "ip", ":", "port", "\"", " ", "or", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "fail", "\\u", "if", "\\u", "exist", "s", ":", " ", "fail", " ", "if", " ", "this", " ", "name", " ", "is", " ", "alr", "ead", "y", " ", "register", "ed", "?", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "the", " ", "address", " ", "give", "n", " ", "or", " ", "construct", "ed", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "start", "\\u", "beacon", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u", "rpc_", "(_", "\"", "advertise", "\"_", ",_", "name_", ",_", "address_", ",_", "fail", "\\u", "if", "\\u", "exists_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "address_", "\\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_", "discover_", "(_", "name_", ",_", "wait", "\\u", "for", "\\u", "s_", "=_", "60_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Discover", " ", "a", " ", "service", " ", "by", " ", "name", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "Look", " ", "for", " ", "an", " ", "adver", "t", " ", "to", " ", "a", " ", "named", " ", "service", "::", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "address", " ", "=", " ", "nw", "0.", "discove", "r", "(\"", "myse", "rvice", "\")", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "name", ":", " ", "any", " ", "text", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "wait", "\\u", "for", "\\u", "s", ":", " ", "how", " ", "many", " ", "second", "s", " ", "to", " ", "wait", " ", "bef", "ore", " ", "gi", "ving", " ", "up", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "the", " ", "address", " ", "found", " ", "or", " ", "Non", "e", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "start", "\\u", "beacon", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "It", "'", "s", " ", "possib", "le", " ", "to", " ", "enter", " ", "a", " ", "deadl", "ock", " ", "situation", " ", "where", " ", "the", " ", "first_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "process", " ", "fires", " ", "off", " ", "a", " ", "discove", "ry", " ", "request", " ", "and", " ", "waits", " ", "for", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "second", " ", "process", " ", "to", " ", "advertise", ".", " ", "Bu", "t", " ", "the", " ", "second", " ", "process", " ", "has", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "connect", " ", "to", " ", "the", " ", "rpc", " ", "port", " ", "of", " ", "the", " ", "first", " ", "process", "'", " ", "beacon", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "its", " ", "advertise", "ment", " ", "is", " ", "queue", "d", " ", "beh", "ind", " ", "the", " ", "pend", "ing", " ", "discove", "ry", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "To", " ", "give", " ", "bot", "h", " ", "a", " ", "chan", "ce", " ", "of", " ", "succe", "eding", " ", "we", " ", "operate", " ", "in", " ", "burst", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "allow", "ing", " ", "them", " ", "to", " ", "interleave", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "t0_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "discovery_", "=_", "\\u", "rpc_", "(_", "\"", "discove", "r", "\"_", ",_", "name_", ",_", "0.5_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "discovery_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "discovery_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "timed", "\\u", "out_", "(_", "t0_", ",_", "wait", "\\u", "for", "\\u", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "discove", "r", "\\u", "all_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Produce", " ", "a", " ", "list", " ", "of", " ", "all", " ", "know", "n", " ", "service", "s", " ", "and", " ", "thei", "r", " ", "addresse", "s", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "As", "k", " ", "for", " ", "all", " ", "know", "n", " ", "service", "s", " ", "as", " ", "a", " ", "list", " ", "of", " ", "2", "-", "tuple", "s", ":", " ", "(", "name", ",", " ", "address", ")", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "coul", "d", ",", " ", "eg", ",", " ", "be", " ", "used", " ", "to", " ", "form", " ", "a", " ", "dictionar", "y", " ", "of", " ", "service", "s", "::", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "service", "s", " ", "=", " ", "dict", "(", "nw", "0.", "discove", "r", "\\u", "all", "())", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "a", " ", "list", " ", "of", " ", "2", "-", "tuple", "s", " ", "[(", "name", ",", " ", "address", "),", " ", "...]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "start", "\\u", "beacon", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u", "rpc_", "(_", "\"", "discove", "r", "\\u", "all", "\"_", ")_", "\\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_", "discove", "r", "\\u", "group_", "(_", "group_", ",_", "exclude_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Produce", " ", "a", " ", "list", " ", "of", " ", "all", " ", "service", "s", " ", "and", " ", "thei", "r", " ", "addresse", "s", " ", "in", " ", "a", " ", "group", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "A", " ", "group", " ", "is", " ", "an", " ", "option", "al", " ", "form", " ", "of", " ", "namespace", " ", "within", " ", "the", " ", "discove", "ry", " ", "mechanism", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "an", " ", "advertise", "d", " ", "name", " ", "has", " ", "the", " ", "form", " ", "<", "group", ">/", "<", "name", ">", " ", "it", " ", "is", " ", "dee", "med", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "belo", "ng", " ", "to", " ", "<", "group", ">.", " ", "Not", "e", " ", "tha", "t", " ", "the", " ", "service", "'", "s", " ", "name", " ", "is", " ", "still", " ", "the", " ", "full", "\\", "10", ";", " ", " ", " ", " ", "string", " ", "<", "group", ">/", "<", "name", ">.", " ", "The", " ", "group", " ", "concept", " ", "is", " ", "simp", "ly", " ", "for", " ", "discove", "ry", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "assist", " ", "different", "iation", ",", " ", "eg", ",", " ", "in", " ", "a", " ", "class", "room", " ", "group", ".", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "group", ":", " ", "the", " ", "name", " ", "of", " ", "a", " ", "group", " ", "prefix", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "exclu", "de", ":", " ", "an", " ", "iterable", " ", "of", " ", "names", " ", "to", " ", "exclu", "de", " ", "(", "or", " ", "Non", "e", ")", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", ":", "return", "s", ":", " ", "a", " ", "list", " ", "of", " ", "2", "-", "tuple", "s", " ", "[(", "name", ",", " ", "address", "),", " ", "...]", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "start", "\\u", "beacon", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "exclude_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "names", "\\u", "to", "\\u", "exclude_", "=_", "set_", "(_", ")_", "\\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 ", " _", "names", "\\u", "to", "\\u", "exclude_", "=_", "set_", "(_", "exclude_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "all", "\\u", "discovere", "d_", "=_", "\\u", "rpc_", "(_", "\"", "discove", "r", "\\u", "all", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "(_", "name_", ",_", "address_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "name_", ",_", "address_", ")_", "in_", "all", "\\u", "discovere", "d_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "name_", "._", "startswith_", "(_", "\"%", "s", "/\"_", "%_", "group_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "and_", "name_", "not_", "in_", "names", "\\u", "to", "\\u", "exclude_", "\\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_", "reset", "\\u", "beacon", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Clear", " ", "the", " ", "adver", "ts", " ", "whi", "ch", " ", "the", " ", "beacon", " ", "is", " ", "carry", "ing", "\\", "10", ";", " ", " ", " ", " ", "\\", "10", ";", " ", " ", " ", " ", "(", "Thi", "s", " ", "is", " ", "most", "ly", " ", "usef", "ul", " ", "whe", "n", " ", "testi", "ng", ",", " ", "to", " ", "get", " ", "a", " ", "fresh", " ", "start", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "start", "\\u", "beacon", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u", "rpc_", "(_", "\"", "reset", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_"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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Redundant comparison
buckket/twtxt/tests/test_models.py
[ { "content": "def test_tweet_ordering():\n now = datetime.now(timezone.utc)\n tweet_1 = Tweet(\"A\", now)\n tweet_2 = Tweet(\"B\", now + timedelta(hours=1))\n tweet_3 = Tweet(\"C\", now + timedelta(hours=2))\n tweet_4 = Tweet(\"D\", now + timedelta(hours=2))\n tweet_5 = Tweet(\"D\", now + timedelta(hours=2))\n\n source = Source(\"foo\", \"bar\")\n\n # explicit testing\n with pytest.raises(TypeError):\n tweet_1 < source\n\n with pytest.raises(TypeError):\n tweet_1 <= source\n\n with pytest.raises(TypeError):\n tweet_1 > source\n\n with pytest.raises(TypeError):\n tweet_1 >= source\n\n assert tweet_1 != source\n\n assert tweet_1 < tweet_2\n assert tweet_1 <= tweet_2\n assert tweet_2 > tweet_1\n assert tweet_2 >= tweet_1\n assert tweet_3 != tweet_4\n assert tweet_5 == tweet_4\n assert tweet_5 >= tweet_4\n assert tweet_5 <= tweet_4\n assert not(tweet_3 <= tweet_4)\n assert not(tweet_3 >= tweet_4)", "metadata": "root.test_tweet_ordering", "header": "['module', '___EOS___']", "index": 53 } ]
[ { "span": "tweet_1 <= tweet_2", "start_line": 79, "start_column": 11, "end_line": 79, "end_column": 29 }, { "span": "tweet_2 > tweet_1", "start_line": 80, "start_column": 11, "end_line": 80, "end_column": 28 }, { "span": "tweet_2 >= tweet_1", "start_line": 81, "start_column": 11, "end_line": 81, "end_column": 29 }, { "span": "tweet_3 >= tweet_4)", "start_line": 87, "start_column": 15, "end_line": 87, "end_column": 33 } ]
[ { "span": "tweet_1 < tweet_2", "start_line": 78, "start_column": 11, "end_line": 78, "end_column": 28 }, { "span": "not(tweet_3 <= tweet_4)", "start_line": 86, "start_column": 11, "end_line": 86, "end_column": 34 } ]
1
true
[ "[CLS]_", "Redu", "ndan", "t_", "comparison_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "tweet", "\\u", "ordering_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "now_", "=_", "datetime_", "._", "now_", "(_", "timezone_", "._", "utc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tweet", "\\u", "1_", "=_", "Tweet", "_", "(_", "\"", "A", "\"_", ",_", "now_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tweet", "\\u", "2_", "=_", "Tweet", "_", "(_", "\"", "B", "\"_", ",_", "now_", "+_", "timedelta_", "(_", "hours_", "=_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tweet", "\\u", "3_", "=_", "Tweet", "_", "(_", "\"", "C", "\"_", ",_", "now_", "+_", "timedelta_", "(_", "hours_", "=_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tweet", "\\u", "4_", "=_", "Tweet", "_", "(_", "\"", "D", "\"_", ",_", "now_", "+_", "timedelta_", "(_", "hours_", "=_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tweet", "\\u", "5_", "=_", "Tweet", "_", "(_", "\"", "D", "\"_", ",_", "now_", "+_", "timedelta_", "(_", "hours_", "=_", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "source_", "=_", "Source_", "(_", "\"", "foo", "\"_", ",_", "\"", "bar", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "explicit", " ", "testing_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Type", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tweet", "\\u", "1_", "<_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Type", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tweet", "\\u", "1_", "<=_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Type", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tweet", "\\u", "1_", ">_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "pytest_", "._", "raises_", "(_", "Type", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tweet", "\\u", "1_", ">=_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "tweet", "\\u", "1_", "!=_", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "tweet", "\\u", "1_", "<_", "tweet", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "tweet", "\\u", "1_", "<=_", "tweet", "\\u", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "tweet", "\\u", "2_", ">_", "tweet", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "tweet", "\\u", "2_", ">=_", "tweet", "\\u", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "tweet", "\\u", "3_", "!=_", "tweet", "\\u", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "tweet", "\\u", "5_", "==_", "tweet", "\\u", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "tweet", "\\u", "5_", ">=_", "tweet", "\\u", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "tweet", "\\u", "5_", "<=_", "tweet", "\\u", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "(_", "tweet", "\\u", "3_", "<=_", "tweet", "\\u", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "(_", "tweet", "\\u", "3_", ">=_", "tweet", "\\u", "4_", ")_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 2 ]
Except block handles 'BaseException'
uwdata/termite-data-server/web2py/gluon/shell.py
[ { "content": "def run(\n appname,\n plain=False,\n import_models=False,\n startfile=None,\n bpython=False,\n python_code=False,\n cronjob=False):\n \"\"\"\n Start interactive shell or run Python script (startfile) in web2py\n controller environment. appname is formatted like:\n\n a web2py application name\n a/c exec the controller c into the application environment\n \"\"\"\n\n (a, c, f, args, vars) = parse_path_info(appname, av=True)\n errmsg = 'invalid application name: %s' % appname\n if not a:\n die(errmsg)\n adir = os.path.join('applications', a)\n\n if not os.path.exists(adir):\n if sys.stdin and not sys.stdin.name == '/dev/null':\n confirm = raw_input(\n 'application %s does not exist, create (y/n)?' % a)\n else:\n logging.warn('application does not exist and will not be created')\n return\n if confirm.lower() in ['y', 'yes']:\n\n os.mkdir(adir)\n w2p_unpack('welcome.w2p', adir)\n for subfolder in ['models', 'views', 'controllers', 'databases',\n 'modules', 'cron', 'errors', 'sessions',\n 'languages', 'static', 'private', 'uploads']:\n subpath = os.path.join(adir, subfolder)\n if not os.path.exists(subpath):\n os.mkdir(subpath)\n db = os.path.join(adir, 'models/db.py')\n if os.path.exists(db):\n data = fileutils.read_file(db)\n data = data.replace(\n '<your secret key>', 'sha512:' + web2py_uuid())\n fileutils.write_file(db, data)\n\n if c:\n import_models = True\n extra_request = {}\n if args:\n extra_request['args'] = args\n if vars:\n extra_request['vars'] = vars\n _env = env(a, c=c, f=f, import_models=import_models, extra_request=extra_request)\n if c:\n pyfile = os.path.join('applications', a, 'controllers', c + '.py')\n pycfile = os.path.join('applications', a, 'compiled',\n \"controllers_%s_%s.pyc\" % (c, f))\n if ((cronjob and os.path.isfile(pycfile))\n or not os.path.isfile(pyfile)):\n exec read_pyc(pycfile) in _env\n elif os.path.isfile(pyfile):\n execfile(pyfile, _env)\n else:\n die(errmsg)\n\n if f:\n exec ('print %s()' % f, _env)\n return\n\n _env.update(exec_pythonrc())\n if startfile:\n try:\n ccode = None\n if startfile.endswith('.pyc'):\n ccode = read_pyc(startfile)\n exec ccode in _env\n else:\n execfile(startfile, _env)\n\n if import_models:\n BaseAdapter.close_all_instances('commit')\n except Exception, e:\n print traceback.format_exc()\n if import_models:\n BaseAdapter.close_all_instances('rollback')\n elif python_code:\n try:\n exec(python_code, _env)\n if import_models:\n BaseAdapter.close_all_instances('commit')\n except Exception, e:\n print traceback.format_exc()\n if import_models:\n BaseAdapter.close_all_instances('rollback')\n else:\n if not plain:\n if bpython:\n try:\n import bpython\n bpython.embed(locals_=_env)\n return\n except:\n logger.warning(\n 'import bpython error; trying ipython...')\n else:\n try:\n import IPython\n if IPython.__version__ > '1.0.0':\n IPython.start_ipython(user_ns=_env)\n return\n elif IPython.__version__ == '1.0.0':\n from IPython.terminal.embed import InteractiveShellEmbed\n shell = InteractiveShellEmbed(user_ns=_env)\n shell()\n return\n elif IPython.__version__ >= '0.11':\n from IPython.frontend.terminal.embed import InteractiveShellEmbed\n shell = InteractiveShellEmbed(user_ns=_env)\n shell()\n return\n else:\n # following 2 lines fix a problem with\n # IPython; thanks Michael Toomim\n if '__builtins__' in _env:\n del _env['__builtins__']\n shell = IPython.Shell.IPShell(argv=[], user_ns=_env)\n shell.mainloop()\n return\n except:\n logger.warning(\n 'import IPython error; use default python shell')\n enable_autocomplete_and_history(adir,_env)\n code.interact(local=_env)", "metadata": "root.run", "header": "['module', '___EOS___']", "index": 187 } ]
[ { "span": "except:", "start_line": 289, "start_column": 16, "end_line": 289, "end_column": 23 }, { "span": "except:", "start_line": 316, "start_column": 16, "end_line": 316, "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "appname_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "plain_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "import", "\\u", "models_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "start", "file_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bpy", "tho", "n_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "python", "\\u", "code_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cron", "job_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Start", " ", "interactive", " ", "shell", " ", "or", " ", "run", " ", "Pyth", "on", " ", "script", " ", "(", "start", "file", ")", " ", "in", " ", "web", "2py", "\\", "10", ";", " ", " ", " ", " ", "controlle", "r", " ", "environ", "ment", ".", " ", "app", "name", " ", "is", " ", "format", "ted", " ", "like", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "a", " ", " ", "web", "2py", " ", "applica", "tion", " ", "name", "\\", "10", ";", " ", " ", " ", " ", "a", "/", "c", " ", " ", " ", " ", "exec", " ", "the", " ", "controlle", "r", " ", "c", " ", "int", "o", " ", "the", " ", "applica", "tion", " ", "environ", "ment", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "a_", ",_", "c_", ",_", "f_", ",_", "args_", ",_", "vars_", ")_", "=_", "parse", "\\u", "path", "\\u", "info_", "(_", "appname_", ",_", "av_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errmsg_", "=_", "'", "invalid", " ", "applica", "tion", " ", "name", ":", " ", "%", "s", "'_", "%_", "appname_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "a_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "die_", "(_", "errmsg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "adir", "_", "=_", "os_", "._", "path_", "._", "join_", "(_", "'", "applica", "tion", "s", "'_", ",_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "adir", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "sys_", "._", "stdin_", "and_", "not_", "sys_", "._", "stdin_", "._", "name_", "==_", "'/", "dev", "/", "null", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "confirm_", "=_", "raw", "\\u", "input_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "applica", "tion", " ", "%", "s", " ", "doe", "s", " ", "not", " ", "exist", ",", " ", "create", " ", "(", "y", "/", "n", ")?'_", "%_", "a_", ")_", "\\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 ", " _", "logging_", "._", "warn_", "(_", "'", "applica", "tion", " ", "doe", "s", " ", "not", " ", "exist", " ", "and", " ", "will", " ", "not", " ", "be", " ", "created", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "confirm_", "._", "lower_", "(_", ")_", "in_", "[_", "'", "y", "'_", ",_", "'", "ye", "s", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "mkdir_", "(_", "adir", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "w2", "p", "\\u", "unpack_", "(_", "'", "welcome", ".", "w2", "p", "'_", ",_", "adir", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "subfolder", "_", "in_", "[_", "'", "model", "s", "'_", ",_", "'", "views", "'_", ",_", "'", "controlle", "rs", "'_", ",_", "'", "databa", "ses", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "module", "s", "'_", ",_", "'", "cron", "'_", ",_", "'", "error", "s", "'_", ",_", "'", "session", "s", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "language", "s", "'_", ",_", "'", "static", "'_", ",_", "'", "private", "'_", ",_", "'", "uploads", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "subpath_", "=_", "os_", "._", "path_", "._", "join_", "(_", "adir", "_", ",_", "subfolder", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "subpath_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "os_", "._", "mkdir_", "(_", "subpath_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "db_", "=_", "os_", "._", "path_", "._", "join_", "(_", "adir", "_", ",_", "'", "model", "s", "/", "db", ".", "py", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "os_", "._", "path_", "._", "exists_", "(_", "db_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "fileu", "tils_", "._", "read", "\\u", "file_", "(_", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "data_", "._", "replace_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'<", "your", " ", "secret", " ", "key", ">'_", ",_", "'", "sha512", ":'_", "+_", "web", "2py", "\\u", "uuid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fileu", "tils_", "._", "write", "\\u", "file_", "(_", "db_", ",_", "data_", ")_", "\\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_", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import", "\\u", "models_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "extra", "\\u", "request_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "extra", "\\u", "request_", "[_", "'", "args", "'_", "]_", "=_", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "vars_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "extra", "\\u", "request_", "[_", "'", "vars", "'_", "]_", "=_", "vars_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "env_", "=_", "env_", "(_", "a_", ",_", "c_", "=_", "c_", ",_", "f_", "=_", "f_", ",_", "import", "\\u", "models_", "=_", "import", "\\u", "models_", ",_", "extra", "\\u", "request_", "=_", "extra", "\\u", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pyfi", "le_", "=_", "os_", "._", "path_", "._", "join_", "(_", "'", "applica", "tion", "s", "'_", ",_", "a_", ",_", "'", "controlle", "rs", "'_", ",_", "c_", "+_", "'.", "py", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pyc", "file_", "=_", "os_", "._", "path_", "._", "join_", "(_", "'", "applica", "tion", "s", "'_", ",_", "a_", ",_", "'", "compile", "d", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "controlle", "rs", "\\u", "%", "s", "\\u", "%", "s", ".", "pyc", "\"_", "%_", "(_", "c_", ",_", "f_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "(_", "cron", "job_", "and_", "os_", "._", "path_", "._", "isfile_", "(_", "pyc", "file_", ")_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "or_", "not_", "os_", "._", "path_", "._", "isfile_", "(_", "pyfi", "le_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exec_", "read", "\\u", "pyc", "_", "(_", "pyc", "file_", ")_", "in_", "\\u", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "os_", "._", "path_", "._", "isfile_", "(_", "pyfi", "le_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "execfile", "_", "(_", "pyfi", "le_", ",_", "\\u", "env_", ")_", "\\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 ", " _", "die_", "(_", "errmsg_", ")_", "\\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_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exec_", "(_", "'", "print", " ", "%", "s", "()'_", "%_", "f_", ",_", "\\u", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "env_", "._", "update_", "(_", "exec", "\\u", "python", "rc_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "start", "file_", ":_", "\\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 ", " _", "cco", "de_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "start", "file_", "._", "endswith_", "(_", "'.", "pyc", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cco", "de_", "=_", "read", "\\u", "pyc", "_", "(_", "start", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exec_", "cco", "de_", "in_", "\\u", "env_", "\\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 ", " _", "execfile", "_", "(_", "start", "file_", ",_", "\\u", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "import", "\\u", "models_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Base", "Adapter_", "._", "close", "\\u", "all", "\\u", "instances_", "(_", "'", "commit", "'_", ")_", "\\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 ", " _", "print_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "import", "\\u", "models_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Base", "Adapter_", "._", "close", "\\u", "all", "\\u", "instances_", "(_", "'", "rollback", "'_", ")_", "\\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_", "python", "\\u", "code_", ":_", "\\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 ", " _", "exec_", "(_", "python", "\\u", "code_", ",_", "\\u", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "import", "\\u", "models_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Base", "Adapter_", "._", "close", "\\u", "all", "\\u", "instances_", "(_", "'", "commit", "'_", ")_", "\\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 ", " _", "print_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "import", "\\u", "models_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Base", "Adapter_", "._", "close", "\\u", "all", "\\u", "instances_", "(_", "'", "rollback", "'_", ")_", "\\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 ", " _", "if_", "not_", "plain_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "bpy", "tho", "n_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "import_", "bpy", "tho", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bpy", "tho", "n_", "._", "embed_", "(_", "locals", "\\u_", "=_", "\\u", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\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 ", " ", "_", "logger_", "._", "warning_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "import", " ", "bpy", "tho", "n", " ", "error", ";", " ", "try", "ing", " ", "ipython", "...'_", ")_", "\\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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "import_", "IP", "ython_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "IP", "ython_", "._", "\\u\\u", "version\\u\\u_", ">_", "'", "1.0", ".0", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "IP", "ython_", "._", "start", "\\u", "ipython", "_", "(_", "user", "\\u", "ns_", "=_", "\\u", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "IP", "ython_", "._", "\\u\\u", "version\\u\\u_", "==_", "'", "1.0", ".0", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "from_", "IP", "ython_", "._", "terminal_", "._", "embed_", "import_", "Interact", "ive", "Shel", "l", "Embed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shell_", "=_", "Interact", "ive", "Shel", "l", "Embed_", "(_", "user", "\\u", "ns_", "=_", "\\u", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "IP", "ython_", "._", "\\u\\u", "version\\u\\u_", ">=_", "'", "0.11", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "from_", "IP", "ython_", "._", "frontend_", "._", "terminal_", "._", "embed_", "import_", "Interact", "ive", "Shel", "l", "Embed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shell_", "=_", "Interact", "ive", "Shel", "l", "Embed_", "(_", "user", "\\u", "ns_", "=_", "\\u", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shell_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "follow", "ing", " ", "2", " ", "lines", " ", "fix", " ", "a", " ", "problem", " ", "with_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IP", "yth", "on", ";", " ", "thanks", " ", "Mich", "ael", " ", "Too", "mi", "m_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "'\\u", "\\u", "bui", "lti", "ns", "\\u\\u'_", "in_", "\\u", "env_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "del_", "\\u", "env_", "[_", "'\\u", "\\u", "bui", "lti", "ns", "\\u\\u'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "shell_", "=_", "IP", "ython_", "._", "Shell_", "._", "IPS", "hell", "_", "(_", "argv_", "=_", "[_", "]_", ",_", "user", "\\u", "ns_", "=_", "\\u", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shell_", "._", "mainloop_", "(_", ")_", "\\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_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "logger_", "._", "warning_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "import", " ", "IP", "yth", "on", " ", "error", ";", " ", "use", " ", "default", " ", "python", " ", "shell", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "enable", "\\u", "autocomplete", "\\u", "and", "\\u", "history_", "(_", "adir", "_", ",_", "\\u", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "code_", "._", "interact", "_", "(_", "local_", "=_", "\\u", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
amrdraz/kodr/app/brython/www/src/Lib/test/seq_tests.py
[ { "content": " def test_constructors(self):\n l0 = []\n l1 = [0]\n l2 = [0, 1]\n\n u = self.type2test()\n u0 = self.type2test(l0)\n u1 = self.type2test(l1)\n u2 = self.type2test(l2)\n\n uu = self.type2test(u)\n uu0 = self.type2test(u0)\n uu1 = self.type2test(u1)\n uu2 = self.type2test(u2)\n\n v = self.type2test(tuple(u))\n class OtherSeq:\n def __init__(self, initseq):\n self.__data = initseq\n def __len__(self):\n return len(self.__data)\n def __getitem__(self, i):\n return self.__data[i]\n s = OtherSeq(u0)\n v0 = self.type2test(s)\n self.assertEqual(len(v0), len(s))\n\n s = \"this is also a sequence\"\n vv = self.type2test(s)\n self.assertEqual(len(vv), len(s))\n\n # Create from various iteratables\n for s in (\"123\", \"\", range(1000), ('do', 1.2), range(2000,2200,5)):\n for g in (Sequence, IterFunc, IterGen,\n itermulti, iterfunc):\n self.assertEqual(self.type2test(g(s)), self.type2test(s))\n self.assertEqual(self.type2test(IterFuncStop(s)), self.type2test())\n self.assertEqual(self.type2test(c for c in \"123\"), self.type2test(\"123\"))\n self.assertRaises(TypeError, self.type2test, IterNextOnly(s))\n self.assertRaises(TypeError, self.type2test, IterNoNext(s))\n self.assertRaises(ZeroDivisionError, self.type2test, IterGenExc(s))", "metadata": "root.CommonTest.test_constructors", "header": "['class', 'CommonTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___NEWLINE___', '# The type to be tested', '___NL___', '___EOS___']", "index": 91 } ]
[ { "span": "uu ", "start_line": 101, "start_column": 8, "end_line": 101, "end_column": 10 }, { "span": "uu0 ", "start_line": 102, "start_column": 8, "end_line": 102, "end_column": 11 }, { "span": "uu1 ", "start_line": 103, "start_column": 8, "end_line": 103, "end_column": 11 }, { "span": "uu2 ", "start_line": 104, "start_column": 8, "end_line": 104, "end_column": 11 }, { "span": "v ", "start_line": 106, "start_column": 8, "end_line": 106, "end_column": 9 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Common", "Test_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "type", " ", "to", " ", "be", " ", "tested", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "construct", "ors_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "l0_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l1_", "=_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l2_", "=_", "[_", "0_", ",_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "u_", "=_", "self_", "._", "type", "2te", "st_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u0", "_", "=_", "self_", "._", "type", "2te", "st_", "(_", "l0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u1_", "=_", "self_", "._", "type", "2te", "st_", "(_", "l1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "u2_", "=_", "self_", "._", "type", "2te", "st_", "(_", "l2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "uu", "_", "=_", "self_", "._", "type", "2te", "st_", "(_", "u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uu", "0_", "=_", "self_", "._", "type", "2te", "st_", "(_", "u0", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uu", "1_", "=_", "self_", "._", "type", "2te", "st_", "(_", "u1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "uu", "2_", "=_", "self_", "._", "type", "2te", "st_", "(_", "u2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "v_", "=_", "self_", "._", "type", "2te", "st_", "(_", "tuple_", "(_", "u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Ot", "her", "Seq_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "inits", "eq_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u\\u", "data_", "=_", "inits", "eq_", "\\u\\u\\uNEWLINE\\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\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getitem\\u\\u_", "(_", "self_", ",_", "i_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "\\u\\u", "data_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "Ot", "her", "Seq_", "(_", "u0", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "v0_", "=_", "self_", "._", "type", "2te", "st_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "v0_", ")_", ",_", "len_", "(_", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "s_", "=_", "\"", "this", " ", "is", " ", "als", "o", " ", "a", " ", "sequence", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vv_", "=_", "self_", "._", "type", "2te", "st_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "len_", "(_", "vv_", ")_", ",_", "len_", "(_", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "from", " ", "vari", "ous", " ", "iter", "atab", "les_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "s_", "in_", "(_", "\"", "123", "\"_", ",_", "\"\"_", ",_", "range_", "(_", "1000_", ")_", ",_", "(_", "'", "do", "'_", ",_", "1.2_", ")_", ",_", "range_", "(_", "2000_", ",_", "2200", "_", ",_", "5_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "g_", "in_", "(_", "Sequence_", ",_", "It", "er", "Func_", ",_", "It", "er", "Gen_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "iter", "multi_", ",_", "iter", "func_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "type", "2te", "st_", "(_", "g_", "(_", "s_", ")_", ")_", ",_", "self_", "._", "type", "2te", "st_", "(_", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "type", "2te", "st_", "(_", "It", "er", "Func", "Stop_", "(_", "s_", ")_", ")_", ",_", "self_", "._", "type", "2te", "st_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "self_", "._", "type", "2te", "st_", "(_", "c_", "for_", "c_", "in_", "\"", "123", "\"_", ")_", ",_", "self_", "._", "type", "2te", "st_", "(_", "\"", "123", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "self_", "._", "type", "2te", "st_", ",_", "It", "er", "Ne", "xt", "Only_", "(_", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Type", "Error_", ",_", "self_", "._", "type", "2te", "st_", ",_", "It", "er", "No", "Next_", "(_", "s_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Raises_", "(_", "Zero", "Divis", "ion", "Error_", ",_", "self_", "._", "type", "2te", "st_", ",_", "It", "er", "Gen", "Exc", "_", "(_", "s_", ")_", ")_", "\\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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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 ]
Variable defined multiple times
borg-project/borg/borg/unix/proc.py
[ { "content": "class ProcessStat(object):\n \"\"\"\n Information about a specific process.\n\n Merely a crude wrapper around the information in the /proc/<pid>/stat file.\n Read the man pages! Read the kernel source! Nothing in /proc is ever quite\n as it seems.\n \"\"\"\n\n __ticks_per_second = os.sysconf(os.sysconf_names[\"SC_CLK_TCK\"])\n __entry_re = re.compile(\"\\\\d+\")\n __stat_re_strings = [\n # signedness decisions were made by examining the kernel source, and in some\n # cases (eg pid) don't make much sense---but who are we in userland to judge?\n \"(?P<pid>-?\\\\d+)\", # process pid\n \"(?P<name>\\\\(.+\\\\))\", # executable name\n \"(?P<state>[RSDZTWX])\", # process state\n \"(?P<ppid>-?\\\\d+)\", # parent's pid\n \"(?P<pgid>-?\\\\d+)\", # process group id\n \"(?P<sid>-?\\\\d+)\", # session id\n \"(?P<tty>-?\\\\d+)\", # tty number\n \"(?P<ttyg>-?\\\\d+)\", # group id of the process which owns the associated tty\n \"(?P<flags>\\\\d+)\", # kernel flags word (kernel-version-dependent)\n \"(?P<min>\\\\d+)\", # minor faults count\n \"(?P<cmin>\\\\d+)\", # waited-for-children minor faults count\n \"(?P<maj>\\\\d+)\", # major faults count\n \"(?P<cmaj>\\\\d+)\", # waited-for-children major faults count\n \"(?P<utime>\\\\d+)\", # user mode jiffies count\n \"(?P<stime>\\\\d+)\", # kernel mode jiffies count\n \"(?P<cutime>-?\\\\d+)\", # waited-for-children user mode jiffies count\n \"(?P<cstime>-?\\\\d+)\", # waited-for-children kernel mode jiffies count\n \"(?P<priority>-?\\\\d+)\", # real-time priority or raw nice value\n \"(?P<nice>-?\\\\d+)\", # signed nice value in [-19, 19]\n \"(?P<nthreads>-?\\\\d+)\", # number of threads in the process (replaced removed field)\n \"0\", # removed-field placeholder\n \"(?P<start>\\\\d+)\", # process start time in jiffies\n \"(?P<vsize>\\\\d+)\", # bytes of process virtual memory\n \"(?P<rss>-?\\\\d+)\", # resident set size minus three\n \"(?P<rlim>\\\\d+)\", # rss limit in bytes\n \"(?P<pbot>\\\\d+)\", # program text bottom address\n \"(?P<ptop>\\\\d+)\", # program text top address\n \"(?P<stack>\\\\d+)\", # stack start address\n \"(?P<esp>\\\\d+)\", # stack pointer address\n \"(?P<eip>\\\\d+)\", # instruction pointer address\n \"(?P<pending>\\\\d+)\", # pending signals bitmap\n \"(?P<blocked>\\\\d+)\", # blocked signals bitmap\n \"(?P<ignored>\\\\d+)\", # ignored signals bitmap\n \"(?P<caught>\\\\d+)\", # caught signals bitmap\n \"(?P<wchan>\\\\d+)\", # process wait channel\n \"\\\\d+\", # zero (in the past, pages swapped)\n \"\\\\d+\", # zero (in the past, childrens' pages swapped)\n \"(?P<dsig>-?\\\\d+)\", # death signal to parent\n \"(?P<cpu>-?\\\\d+)\", # last CPU of execution\n \"(?P<rtprio>\\\\d+)\", # real-time scheduling priority\n \"(?P<policy>\\\\d+)\", # scheduling policy\n \"(?P<blkio>\\\\d+)\", # clock ticks of block I/O delays\n \"(?P<gtime>\\\\d+)\", # process guest time in clock ticks\n \"(?P<cgtime>\\\\d+)\", # waited-for-children's guest time in clock ticks\n ]\n __stat_res = [re.compile(s) for s in __stat_re_strings]\n\n\n# for i in fields:\n# m = ProcessStat.__stat_res[i].match(strings[i])\n\n# self.__d.update(m.groupdict())\n\n\n\n\n # expose the relevant fields\n pid = property(lambda self: int(self.__d[\"pid\"]))\n name = property(lambda self: self.__d[\"name\"])\n state = property(lambda self: self.__d[\"state\"])\n ppid = property(lambda self: int(self.__d[\"ppid\"]))\n pgid = property(lambda self: int(self.__d[\"pgid\"]))\n sid = property(lambda self: int(self.__d[\"sid\"]))\n tty = property(lambda self: int(self.__d[\"tty\"]))\n tty_owner_group = property(lambda self: int(self.__d[\"ttyg\"]))\n flags = property(lambda self: long(self.__d[\"flags\"]))\n minor_faults = property(lambda self: long(self.__d[\"min\"]))\n child_minor_faults = property(lambda self: long(self.__d[\"cmin\"]))\n major_faults = property(lambda self: long(self.__d[\"maj\"]))\n child_major_faults = property(lambda self: long(self.__d[\"cmaj\"]))\n user_time = property(lambda self: self.__ticks_to_timedelta(self.__d[\"utime\"]))\n kernel_time = property(lambda self: self.__ticks_to_timedelta(self.__d[\"stime\"]))\n child_user_time = property(lambda self: self.__ticks_to_timedelta(self.__d[\"cutime\"]))\n child_kernel_time = property(lambda self: self.__ticks_to_timedelta(self.__d[\"cstime\"]))\n priority = property(lambda self: int(self.__d[\"priority\"]))\n nice = property(lambda self: int(self.__d[\"nice\"]))\n threads = property(lambda self: int(self.__d[\"nthreads\"]))\n start_time = property(lambda self: self.__ticks_to_timedelta(self.__d[\"start\"]))\n virtual_size = property(lambda self: long(self.__d[\"vsize\"]))\n resident_set_size = property(lambda self: int(self.__d[\"rss\"]))\n resident_set_limit = property(lambda self: long(self.__d[\"rlim\"]))\n text_bottom = property(lambda self: long(self.__d[\"pbot\"]))\n text_top = property(lambda self: long(self.__d[\"ptop\"]))\n stack_start = property(lambda self: long(self.__d[\"stack\"]))\n stack_pointer = property(lambda self: long(self.__d[\"esp\"]))\n instruction_pointer = property(lambda self: long(self.__d[\"eip\"]))\n pending_signals = property(lambda self: long(self.__d[\"pending\"]))\n blocked_signals = property(lambda self: long(self.__d[\"blocked\"]))\n ignored_signals = property(lambda self: long(self.__d[\"ignored\"]))\n caught_signals = property(lambda self: long(self.__d[\"caught\"]))\n wait_channel = property(lambda self: long(self.__d[\"wchan\"]))\n exit_signal = property(lambda self: int(self.__d[\"dsig\"]))\n last_cpu = property(lambda self: int(self.__d[\"cpu\"]))\n priority = property(lambda self: long(self.__d[\"rtprio\"]))\n policy = property(lambda self: long(self.__d[\"policy\"]))\n io_delay = property(lambda self: long(self.__d[\"blkio\"]))\n guest_time = property(lambda self: self.__ticks_to_timedelta(self.__d[\"gtime\"]))\n child_guest_time = property(lambda self: self.__ticks_to_timedelta(self.__d[\"cgtime\"]))", "metadata": "root.ProcessStat", "header": "['module', '___EOS___']", "index": 9 } ]
[ { "span": "priority ", "start_line": 139, "start_column": 4, "end_line": 139, "end_column": 12 } ]
[ { "span": "priority ", "start_line": 158, "start_column": 4, "end_line": 158, "end_column": 12 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Process", "Stat_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Information", " ", "abo", "ut", " ", "a", " ", "specific", " ", "process", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Mer", "el", "y", " ", "a", " ", "crud", "e", " ", "wrapp", "er", " ", "aro", "und", " ", "the", " ", "informati", "on", " ", "in", " ", "the", " ", "/", "proc", "/", "<", "pid", ">/", "stat", " ", "file", ".", "\\", "10", ";", " ", " ", " ", " ", "Read", " ", "the", " ", "man", " ", "page", "s", "!", " ", "Read", " ", "the", " ", "kernel", " ", "source", "!", " ", "Not", "hing", " ", "in", " ", "/", "proc", " ", "is", " ", "ever", " ", "quite", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "it", " ", "see", "ms", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u", "tick", "s", "\\u", "per", "\\u", "second_", "=_", "os_", "._", "sysc", "onf_", "(_", "os_", "._", "sysc", "onf", "\\u", "names_", "[_", "\"", "SC", "\\u", "CLK", "\\u", "TC", "K", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "entry", "\\u", "re_", "=_", "re_", "._", "compile_", "(_", "\"\\\\\\\\", "d", "+\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "stat", "\\u", "re", "\\u", "strings_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sign", "edn", "ess", " ", "decision", "s", " ", "wer", "e", " ", "made", " ", "by", " ", "exam", "inin", "g", " ", "the", " ", "kernel", " ", "source", ",", " ", "and", " ", "in", " ", "some", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "case", "s", " ", "(", "eg", " ", "pid", ")", " ", "don", "'", "t", " ", "make", " ", "muc", "h", " ", "sense", "---", "but", " ", "who", " ", "are", " ", "we", " ", "in", " ", "userl", "and", " ", "to", " ", "judge", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "pid", ">-", "?\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "process", " ", "pid_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "name", ">\\\\", "\\\\(", ".+", "\\\\\\\\", "))\"_", ",_", "#", " ", "executable", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "state", ">[", "RS", "DZ", "TW", "X", "])\"_", ",_", "#", " ", "process", " ", "state_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "ppi", "d", ">-", "?\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "parent", "'", "s", " ", "pid_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "pg", "id", ">-", "?\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "process", " ", "group", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "sid", ">-", "?\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "session", " ", "id_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "tt", "y", ">-", "?\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "tt", "y", " ", "number_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "tt", "yg", ">-", "?\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "group", " ", "id", " ", "of", " ", "the", " ", "process", " ", "whi", "ch", " ", "owns", " ", "the", " ", "associate", "d", " ", "tty_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "flags", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "kernel", " ", "flags", " ", "word", " ", "(", "kernel", "-", "version", "-", "dependent", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "min", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "mino", "r", " ", "faults", " ", "count_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "cmi", "n", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "wait", "ed", "-", "for", "-", "child", "ren", " ", "mino", "r", " ", "faults", " ", "count_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "maj", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "major", " ", "faults", " ", "count_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "cma", "j", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "wait", "ed", "-", "for", "-", "child", "ren", " ", "major", " ", "faults", " ", "count_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "utime", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "user", " ", "mode", " ", "ji", "ffi", "es", " ", "count_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "stime", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "kernel", " ", "mode", " ", "ji", "ffi", "es", " ", "count_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "cut", "ime", ">-", "?\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "wait", "ed", "-", "for", "-", "child", "ren", " ", "user", " ", "mode", " ", "ji", "ffi", "es", " ", "count_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "cst", "ime", ">-", "?\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "wait", "ed", "-", "for", "-", "child", "ren", " ", "kernel", " ", "mode", " ", "ji", "ffi", "es", " ", "count_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "priorit", "y", ">-", "?\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "real", "-", "time", " ", "priorit", "y", " ", "or", " ", "raw", " ", "nice", " ", "value_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "nice", ">-", "?\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "sign", "ed", " ", "nice", " ", "value", " ", "in", " ", "[-", "1", "9", ",", " ", "1", "9", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "nthr", "eads", ">-", "?\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "number", " ", "of", " ", "thread", "s", " ", "in", " ", "the", " ", "process", " ", "(", "replaced", " ", "remove", "d", " ", "field", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "0", "\"_", ",_", "#", " ", "remove", "d", "-", "field", " ", "placeholder_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "start", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "process", " ", "start", " ", "time", " ", "in", " ", "ji", "ffi", "es_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "vsi", "ze", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "bytes", " ", "of", " ", "process", " ", "virtual", " ", "memory_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "rs", "s", ">-", "?\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "resident", " ", "set", " ", "size", " ", "minu", "s", " ", "three_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "rli", "m", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "rs", "s", " ", "limit", " ", "in", " ", "bytes_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "pbo", "t", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "program", " ", "text", " ", "bottom", " ", "address_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "pto", "p", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "program", " ", "text", " ", "top", " ", "address_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "stack", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "stack", " ", "start", " ", "address_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "esp", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "stack", " ", "point", "er", " ", "address_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "eip", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "instruct", "ion", " ", "point", "er", " ", "address_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "pend", "ing", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "pend", "ing", " ", "signal", "s", " ", "bitmap_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "block", "ed", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "block", "ed", " ", "signal", "s", " ", "bitmap_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "ignore", "d", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "ignore", "d", " ", "signal", "s", " ", "bitmap_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "cau", "ght", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "cau", "ght", " ", "signal", "s", " ", "bitmap_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "wc", "han", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "process", " ", "wait", " ", "channel_", "\\u\\u\\uNL\\u\\u\\u_", "\"\\\\\\\\", "d", "+\"_", ",_", "#", " ", "zero", " ", "(", "in", " ", "the", " ", "past", ",", " ", "page", "s", " ", "swapp", "ed", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\"\\\\\\\\", "d", "+\"_", ",_", "#", " ", "zero", " ", "(", "in", " ", "the", " ", "past", ",", " ", "child", "ren", "s", "'", " ", "page", "s", " ", "swapp", "ed", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "dsi", "g", ">-", "?\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "death", " ", "signal", " ", "to", " ", "parent_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "cpu", ">-", "?\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "last", " ", "CPU", " ", "of", " ", "execution_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "rtp", "rio", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "real", "-", "time", " ", "sched", "ulin", "g", " ", "priority_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "policy", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "sched", "ulin", "g", " ", "policy_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "blk", "io", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "clock", " ", "tick", "s", " ", "of", " ", "block", " ", "I", "/", "O", " ", "delays", "_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "gti", "me", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "process", " ", "guest", " ", "time", " ", "in", " ", "clock", " ", "ticks_", "\\u\\u\\uNL\\u\\u\\u_", "\"(?", "P", "<", "cg", "time", ">\\\\", "\\\\", "d", "+)\"_", ",_", "#", " ", "wait", "ed", "-", "for", "-", "child", "ren", "'", "s", " ", "guest", " ", "time", " ", "in", " ", "clock", " ", "ticks_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "stat", "\\u", "res_", "=_", "[_", "re_", "._", "compile_", "(_", "s_", ")_", "for_", "s_", "in_", "\\u\\u", "stat", "\\u", "re", "\\u", "strings_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "for", " ", "i", " ", "in", " ", "fields", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "m", " ", "=", " ", "Process", "Stat", ".\\u", "\\u", "stat", "\\u", "res", "[", "i", "].", "match", "(", "string", "s", "[", "i", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", " ", "self", ".\\u", "\\u", "d", ".", "update", "(", "m", ".", "group", "dict", "())", "_", "\\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_", "#", " ", "expos", "e", " ", "the", " ", "rele", "van", "t", " ", "fields_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pid_", "=_", "property_", "(_", "lambda_", "self_", ":_", "int_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "pid", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "name_", "=_", "property_", "(_", "lambda_", "self_", ":_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "name", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "state_", "=_", "property_", "(_", "lambda_", "self_", ":_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "state", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ppi", "d_", "=_", "property_", "(_", "lambda_", "self_", ":_", "int_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "ppi", "d", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pg", "id_", "=_", "property_", "(_", "lambda_", "self_", ":_", "int_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "pg", "id", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sid_", "=_", "property_", "(_", "lambda_", "self_", ":_", "int_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "sid", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tty_", "=_", "property_", "(_", "lambda_", "self_", ":_", "int_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "tt", "y", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tt", "y", "\\u", "owner", "\\u", "group_", "=_", "property_", "(_", "lambda_", "self_", ":_", "int_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "tt", "yg", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flags_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "flags", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mino", "r", "\\u", "faults", "_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "min", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "child", "\\u", "mino", "r", "\\u", "faults", "_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "cmi", "n", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "major", "\\u", "faults", "_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "maj", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "child", "\\u", "major", "\\u", "faults", "_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "cma", "j", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user", "\\u", "time_", "=_", "property_", "(_", "lambda_", "self_", ":_", "self_", "._", "\\u\\u", "tick", "s", "\\u", "to", "\\u", "timedelta_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "utime", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kernel", "\\u", "time_", "=_", "property_", "(_", "lambda_", "self_", ":_", "self_", "._", "\\u\\u", "tick", "s", "\\u", "to", "\\u", "timedelta_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "stime", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "child", "\\u", "user", "\\u", "time_", "=_", "property_", "(_", "lambda_", "self_", ":_", "self_", "._", "\\u\\u", "tick", "s", "\\u", "to", "\\u", "timedelta_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "cut", "ime", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "child", "\\u", "kernel", "\\u", "time_", "=_", "property_", "(_", "lambda_", "self_", ":_", "self_", "._", "\\u\\u", "tick", "s", "\\u", "to", "\\u", "timedelta_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "cst", "ime", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "priority_", "=_", "property_", "(_", "lambda_", "self_", ":_", "int_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "priorit", "y", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nice_", "=_", "property_", "(_", "lambda_", "self_", ":_", "int_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "nice", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "threads_", "=_", "property_", "(_", "lambda_", "self_", ":_", "int_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "nthr", "eads", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "time_", "=_", "property_", "(_", "lambda_", "self_", ":_", "self_", "._", "\\u\\u", "tick", "s", "\\u", "to", "\\u", "timedelta_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "start", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "virtual", "\\u", "size_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "vsi", "ze", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resident", "\\u", "set\\u", "size_", "=_", "property_", "(_", "lambda_", "self_", ":_", "int_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "rs", "s", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resident", "\\u", "set\\u", "limit_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "rli", "m", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "bottom_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "pbo", "t", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "top_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "pto", "p", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "\\u", "start_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "stack", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack", "\\u", "pointer_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "esp", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "instruct", "ion", "\\u", "pointer_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "eip", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pend", "ing", "\\u", "signals_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "pend", "ing", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "block", "ed", "\\u", "signals_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "block", "ed", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ignore", "d\\u", "signals_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "ignore", "d", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cau", "ght", "\\u", "signals_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "cau", "ght", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wait", "\\u", "channel_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "wc", "han", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exit", "\\u", "signal_", "=_", "property_", "(_", "lambda_", "self_", ":_", "int_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "dsi", "g", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "last", "\\u", "cpu_", "=_", "property_", "(_", "lambda_", "self_", ":_", "int_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "cpu", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "priority_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "rtp", "rio", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "policy_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "policy", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "io", "\\u", "delay_", "=_", "property_", "(_", "lambda_", "self_", ":_", "long_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "blk", "io", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "guest", "\\u", "time_", "=_", "property_", "(_", "lambda_", "self_", ":_", "self_", "._", "\\u\\u", "tick", "s", "\\u", "to", "\\u", "timedelta_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "gti", "me", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "child", "\\u", "guest", "\\u", "time_", "=_", "property_", "(_", "lambda_", "self_", ":_", "self_", "._", "\\u\\u", "tick", "s", "\\u", "to", "\\u", "timedelta_", "(_", "self_", "._", "\\u\\u", "d_", "[_", "\"", "cg", "time", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 ]
Unused import
kvh/ramp/ramp/selectors.py
[ { "content": "import logging\nfrom utils import _pprint\nfrom pandas import Series, concat\nfrom scipy.stats import norm\nimport random\nimport hashlib\nimport math\nimport copy\nimport numpy as np\nfrom sklearn import cross_validation, ensemble, linear_model\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class Selector(object):\n", "metadata": "root.Selector", "header": "['module', '___EOS___']", "index": 12 }, { "content": " def __init__(self, verbose=False):\n self.verbose = verbose", "metadata": "root.Selector.__init__", "header": "['class', 'Selector', '(', 'object', ')', ':', '___EOS___']", "index": 13 }, { "content": " def __repr__(self):\n return '%s(%s)'%(self.__class__.__name__, _pprint(self.__dict__))", "metadata": "root.Selector.__repr__", "header": "['class', 'Selector', '(', 'object', ')', ':', '___EOS___']", "index": 16 }, { "content": "class RandomForestSelector(Selector):\n\n\n# sets = [[t[1] for t in imps[:i+1]] for i in range(len(imps))]\n# return sets\n", "metadata": "root.RandomForestSelector", "header": "['module', '___EOS___']", "index": 20 }, { "content": " def __init__(self, n=100, thresh=None, min_=True, classifier=True,\n seed=2345, *args, **kwargs):\n self.n = n\n self.min = min_\n self.thresh = thresh\n self.seed = seed\n self.classifier = classifier\n super(RandomForestSelector, self).__init__(*args, **kwargs)", "metadata": "root.RandomForestSelector.__init__", "header": "['class', 'RandomForestSelector', '(', 'Selector', ')', ':', '___EOS___']", "index": 22 }, { "content": " def select(self, x, y, n_keep):\n cls = ensemble.RandomForestRegressor\n if self.classifier:\n cls = ensemble.RandomForestClassifier\n rf = cls(n_estimators=self.n,\n random_state=self.seed,\n n_jobs=-1)\n rf.fit(x.values, y.values)\n importances = rf.feature_importances_\n imps = sorted(zip(importances, x.columns),\n reverse=True)\n for i, x in enumerate(imps):\n imp, f = x\n logging.debug('%d\\t%0.4f\\t%s'%(i,imp, f))\n if self.thresh:\n imps = [t for t in imps if t[0] > self.thresh]\n return [t[1] for t in imps[:n_keep]]", "metadata": "root.RandomForestSelector.select", "header": "['class', 'RandomForestSelector', '(', 'Selector', ')', ':', '___EOS___']", "index": 31 }, { "content": " def sets_cv(self, x, y):\n totals = [0]*len(x.columns)\n if self.min:\n totals = [1000] * len(x.columns)\n i = 0\n for train, test in cross_validation.KFold(n=len(y), k=4):\n i += 1\n logging.info(\"RF selector computing importances for fold {i}\".format(i=i))\n cls = ensemble.RandomForestRegressor\n if self.classifier:\n cls = ensemble.RandomForestClassifier\n rf = cls(n_estimators=self.n,\n random_state=self.seed,\n n_jobs=-1)\n rf.fit(x.values[train], y.values[train])\n importances = rf.feature_importances_\n if self.min:\n totals = [min(imp, t) for imp, t in zip(importances, totals)]\n else:\n totals = [imp + t for imp, t in zip(importances, totals)]\n imps = sorted(zip(totals, x.columns),\n reverse=True)\n for i, x in enumerate(imps):\n imp, f = x\n logging.debug('%d\\t%0.4f\\t%s' % (i, imp, f))\n if self.thresh:\n imps = [t for t in imps if t[0] > self.thresh]\n sets = [[t[1] for t in imps[:i+1]] for i in range(len(imps))]\n return sets", "metadata": "root.RandomForestSelector.sets_cv", "header": "['class', 'RandomForestSelector', '(', 'Selector', ')', ':', '___EOS___']", "index": 51 }, { "content": "class StepwiseForwardSelector(Selector):\n", "metadata": "root.StepwiseForwardSelector", "header": "['module', '___EOS___']", "index": 82 }, { "content": " def __init__(self, n=100, min_=True):\n self.n = n\n self.min = min_", "metadata": "root.StepwiseForwardSelector.__init__", "header": "['class', 'StepwiseForwardSelector', '(', 'Selector', ')', ':', '___EOS___']", "index": 83 }, { "content": " def sets(self, x, y):\n lm = linear_model.LinearRegression(normalize=True)\n remaining = x.columns\n curr = []\n logging.debug(\"stepwise forward\")\n for i in range(self.n):\n if i % 10 == 0:\n logging.debug(\"{i} features\".format(i=i))\n coefs = []\n for col in remaining:\n cols = curr + [col]\n fcf = 1e12\n for train, test in cross_validation.KFold(n=len(y), k=4):\n # computes fits over folds, uses lowest computed\n # coefficient as value for comparison\n lm.fit(x[cols].values[train], y.values[train])\n cf = lm.coef_[-1]\n if np.isnan(x[col].std()) or x[col].std() < 1e-7:\n cf = 0\n cf = abs(cf)\n fcf = min(cf, fcf)\n coefs.append(fcf)\n coef, col = max(zip(coefs, remaining))\n logging.debug(\"adding column: {col}\".format(col=col))\n curr.append(col)\n remaining = remaining.drop([col])\n yield list(curr)", "metadata": "root.StepwiseForwardSelector.sets", "header": "['class', 'StepwiseForwardSelector', '(', 'Selector', ')', ':', '___EOS___']", "index": 87 }, { "content": "class LassoPathSelector(Selector):\n", "metadata": "root.LassoPathSelector", "header": "['module', '___EOS___']", "index": 116 }, { "content": " def sets(self, x, y, n_keep):\n alphas, active, coef_path = linear_model.lars_path(x.values, y.values)\n sets = []\n seen = set()\n logging.debug(coef_path)\n for coefs in coef_path.T:\n cols = [x.columns[i] for i in range(len(coefs)) if coefs[i] > 1e-9]\n if len(cols) >= n_keep:\n return cols\n return cols", "metadata": "root.LassoPathSelector.sets", "header": "['class', 'LassoPathSelector', '(', 'Selector', ')', ':', '___EOS___']", "index": 118 }, { "content": "class BinaryFeatureSelector(Selector):\n \"\"\" Only for classification and binary(-able) features \"\"\"\n\n\n\n", "metadata": "root.BinaryFeatureSelector", "header": "['module', '___EOS___']", "index": 130 }, { "content": " def __init__(self, type='bns', *args, **kwargs):\n \"\"\" type in ('ig', 'bns', 'acc')\n see: jmlr.csail.mit.edu/papers/volume3/forman03a/forman03a.pdf\"\"\"\n self.type = type\n super(BinaryFeatureSelector, self).__init__(*args, **kwargs)", "metadata": "root.BinaryFeatureSelector.__init__", "header": "['class', 'BinaryFeatureSelector', '(', 'Selector', ')', ':', '___EOS___']", "index": 133 }, { "content": " def select(self, x, y, n_keep):\n cnts = y.value_counts()\n logging.info(\"Computing binary feature scores for %d features...\" % len(x.columns))\n if len(cnts) > 2:\n scores = self.round_robin(x, y, n_keep)\n else:\n scores = self.rank(x, y)\n scores = [s[1] for s in scores]\n logging.debug(scores[:200])\n return scores[:n_keep]", "metadata": "root.BinaryFeatureSelector.select", "header": "['class', 'BinaryFeatureSelector', '(', 'Selector', ')', ':', '___EOS___']", "index": 139 }, { "content": " def round_robin(self, x, y, n_keep):\n \"\"\" Ensures all classes get representative features, not just those with strong features \"\"\"\n vals = y.unique()\n scores = {}\n for cls in vals:\n scores[cls] = self.rank(x, np.equal(cls, y).astype('Int64'))\n scores[cls].reverse()\n keepers = set()\n while len(keepers) < n_keep:\n for cls in vals:\n keepers.add(scores[cls].pop()[1])\n return list(keepers)", "metadata": "root.BinaryFeatureSelector.round_robin", "header": "['class', 'BinaryFeatureSelector', '(', 'Selector', ')', ':', '___EOS___']", "index": 150 }, { "content": " def rank(self, x, y):\n cnts = y.value_counts()\n scores = []\n\n def e(x, y):\n if abs(y) < .000000001:\n yx = 0\n lyx = 0\n else:\n yx = y / (x + y)\n lyx = math.log(y / (x + y))\n if abs(x) < .000000001:\n xy = 0\n lxy = 0\n else:\n xy = x / (x + y)\n lxy = math.log(x / (x + y))\n return - xy * lxy - yx * lyx\n\n for c in x.columns:\n true_positives = float(np.count_nonzero(np.logical_and(x[c], y)))\n false_positives = float(np.count_nonzero(np.logical_and(x[c], np.logical_not(y))))\n pos = float(cnts[1])\n neg = float(cnts[0])\n n = pos + neg\n if self.type == 'bns':\n tpr = max(0.0005, true_positives / pos)\n fpr = max(0.0005, false_positives / neg)\n tpr = min(.9995, tpr)\n fpr = min(.9995, fpr)\n score = abs(norm.ppf(tpr) - norm.ppf(fpr))\n elif self.type == 'acc':\n score = abs(tpr - fpr)\n elif self.type == 'ig':\n score = e(pos, neg) - ( (true_positives + false_positives) / n * e(true_positives, false_positives)\n + (1 - (true_positives + false_positives) / n) * e(pos - true_positives, neg - false_positives))\n scores.append((score, c))\n scores.sort(reverse=True)\n return scores", "metadata": "root.BinaryFeatureSelector.rank", "header": "['class', 'BinaryFeatureSelector', '(', 'Selector', ')', ':', '___EOS___']", "index": 163 }, { "content": "class InformationGainSelector(Selector):\n \"\"\" Only for binary classification \"\"\"\n", "metadata": "root.InformationGainSelector", "header": "['module', '___EOS___']", "index": 204 }, { "content": " def sets(self, x, y, n_keep):\n cnts = y.value_counts()\n assert(len(cnts) == 2)\n logging.info(\"Computing IG scores...\")\n scores = []\n for c in x.columns:\n true_positives = sum(np.logical_and(x[c], y))\n false_positives = sum(np.logical_and(x[c], np.logical_not(y)))\n score = abs(norm.ppf(true_positives / float(cnts[1])) - norm.ppf(false_positives / float(cnts[0])))\n scores.append((score, c))\n scores.sort(reverse=True)\n return [s[1] for s in scores[:n_keep]]", "metadata": "root.InformationGainSelector.sets", "header": "['class', 'InformationGainSelector', '(', 'Selector', ')', ':', '___EOS___']", "index": 207 } ]
[ { "span": "from pandas import Series, concat", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 33 }, { "span": "import random", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 13 }, { "span": "import hashlib", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 14 }, { "span": "import copy", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 11 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "utils_", "import_", "\\u", "pprint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pandas_", "import_", "Series_", ",_", "concat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "scipy_", "._", "stats_", "import_", "norm_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "math_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "copy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "import_", "cross", "\\u", "validation_", ",_", "ensemble_", ",_", "linear", "\\u", "model_", "\\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_", "Selector_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Selector_", "(_", "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_", ",_", "verbose_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "verbose_", "=_", "verbose_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Selector_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'%", "s", "(%", "s", ")'_", "%_", "(_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "\\u", "pprint_", "(_", "self_", "._", "\\u\\u", "dict\\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_", "Random", "Fore", "st", "Selector_", "(_", "Selector_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "sets", " ", "=", " ", "[[", "t", "[", "1", "]", " ", "for", " ", "t", " ", "in", " ", "imp", "s", "[:", "i", "+", "1", "]]", " ", "for", " ", "i", " ", "in", " ", "range", "(", "len", "(", "imp", "s", "))", "]_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "return", " ", "sets_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Random", "Fore", "st", "Selector_", "(_", "Selector_", ")_", ":_", "\\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_", ",_", "n_", "=_", "100_", ",_", "thresh_", "=_", "None_", ",_", "min", "\\u_", "=_", "True_", ",_", "classifier_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "seed_", "=_", "2345", "_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "n_", "=_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "min_", "=_", "min", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "thresh_", "=_", "thresh_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "seed_", "=_", "seed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "classifier_", "=_", "classifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Random", "Fore", "st", "Selector_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Random", "Fore", "st", "Selector_", "(_", "Selector_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "select_", "(_", "self_", ",_", "x_", ",_", "y_", ",_", "n", "\\u", "keep_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "=_", "ensemble_", "._", "Random", "Fore", "st", "Regressor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "classifier_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "=_", "ensemble_", "._", "Random", "Fore", "st", "Classifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rf_", "=_", "cls_", "(_", "n", "\\u", "estimators_", "=_", "self_", "._", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "random", "\\u", "state_", "=_", "self_", "._", "seed_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "jobs_", "=_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf_", "._", "fit_", "(_", "x_", "._", "values_", ",_", "y_", "._", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "importance", "s_", "=_", "rf_", "._", "feature", "\\u", "importance", "s\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "imp", "s_", "=_", "sorted_", "(_", "zip_", "(_", "importance", "s_", ",_", "x_", "._", "columns_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "x_", "in_", "enumerate_", "(_", "imp", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "imp_", ",_", "f_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'%", "d", "\\\\", "t", "%", "0.", "4f", "\\\\", "t", "%", "s", "'_", "%_", "(_", "i_", ",_", "imp_", ",_", "f_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "thresh_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "imp", "s_", "=_", "[_", "t_", "for_", "t_", "in_", "imp", "s_", "if_", "t_", "[_", "0_", "]_", ">_", "self_", "._", "thresh_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "[_", "t_", "[_", "1_", "]_", "for_", "t_", "in_", "imp", "s_", "[_", ":_", "n", "\\u", "keep_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Random", "Fore", "st", "Selector_", "(_", "Selector_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sets", "\\u", "cv_", "(_", "self_", ",_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "totals_", "=_", "[_", "0_", "]_", "*_", "len_", "(_", "x_", "._", "columns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "min_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "totals_", "=_", "[_", "1000_", "]_", "*_", "len_", "(_", "x_", "._", "columns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "i_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "train_", ",_", "test_", "in_", "cross", "\\u", "validation_", "._", "KF", "old_", "(_", "n_", "=_", "len_", "(_", "y_", ")_", ",_", "k_", "=_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "RF", " ", "select", "or", " ", "compu", "ting", " ", "importance", "s", " ", "for", " ", "fold", " ", "{", "i", "}\"_", "._", "format_", "(_", "i_", "=_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cls_", "=_", "ensemble_", "._", "Random", "Fore", "st", "Regressor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "classifier_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cls_", "=_", "ensemble_", "._", "Random", "Fore", "st", "Classifier_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rf_", "=_", "cls_", "(_", "n", "\\u", "estimators_", "=_", "self_", "._", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "random", "\\u", "state_", "=_", "self_", "._", "seed_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "n", "\\u", "jobs_", "=_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rf_", "._", "fit_", "(_", "x_", "._", "values_", "[_", "train_", "]_", ",_", "y_", "._", "values_", "[_", "train_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "importance", "s_", "=_", "rf_", "._", "feature", "\\u", "importance", "s\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "min_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "totals_", "=_", "[_", "min_", "(_", "imp_", ",_", "t_", ")_", "for_", "imp_", ",_", "t_", "in_", "zip_", "(_", "importance", "s_", ",_", "totals_", ")_", "]_", "\\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 ", " _", "totals_", "=_", "[_", "imp_", "+_", "t_", "for_", "imp_", ",_", "t_", "in_", "zip_", "(_", "importance", "s_", ",_", "totals_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "imp", "s_", "=_", "sorted_", "(_", "zip_", "(_", "totals_", ",_", "x_", "._", "columns_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", ",_", "x_", "in_", "enumerate_", "(_", "imp", "s_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "imp_", ",_", "f_", "=_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'%", "d", "\\\\", "t", "%", "0.", "4f", "\\\\", "t", "%", "s", "'_", "%_", "(_", "i_", ",_", "imp_", ",_", "f_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "thresh_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "imp", "s_", "=_", "[_", "t_", "for_", "t_", "in_", "imp", "s_", "if_", "t_", "[_", "0_", "]_", ">_", "self_", "._", "thresh_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sets_", "=_", "[_", "[_", "t_", "[_", "1_", "]_", "for_", "t_", "in_", "imp", "s_", "[_", ":_", "i_", "+_", "1_", "]_", "]_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "imp", "s_", ")_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "sets_", "\\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_", "Step", "wis", "e", "Forward", "Selector_", "(_", "Selector_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Step", "wis", "e", "Forward", "Selector_", "(_", "Selector_", ")_", ":_", "\\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_", ",_", "n_", "=_", "100_", ",_", "min", "\\u_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "n_", "=_", "n_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "min_", "=_", "min", "\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Step", "wis", "e", "Forward", "Selector_", "(_", "Selector_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sets_", "(_", "self_", ",_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lm_", "=_", "linear", "\\u", "model_", "._", "Linea", "r", "Regression_", "(_", "normalize_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "remaining_", "=_", "x_", "._", "columns_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curr_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "\"", "step", "wis", "e", " ", "forward", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "n_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "i_", "%_", "10_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "\"{", "i", "}", " ", "features", "\"_", "._", "format_", "(_", "i_", "=_", "i_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "coefs_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "col_", "in_", "remaining_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cols_", "=_", "curr_", "+_", "[_", "col_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fcf", "_", "=_", "1e1", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "train_", ",_", "test_", "in_", "cross", "\\u", "validation_", "._", "KF", "old_", "(_", "n_", "=_", "len_", "(_", "y_", ")_", ",_", "k_", "=_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "compute", "s", " ", "fits", " ", "over", " ", "fold", "s", ",", " ", "use", "s", " ", "lowe", "st", " ", "compute", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "coefficient", " ", "as", " ", "value", " ", "for", " ", "comparison_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "lm_", "._", "fit_", "(_", "x_", "[_", "cols_", "]_", "._", "values_", "[_", "train_", "]_", ",_", "y_", "._", "values_", "[_", "train_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cf_", "=_", "lm_", "._", "coef\\u", "_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "np_", "._", "isnan_", "(_", "x_", "[_", "col_", "]_", "._", "std_", "(_", ")_", ")_", "or_", "x_", "[_", "col_", "]_", "._", "std_", "(_", ")_", "<_", "1e-", "7_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "cf_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cf_", "=_", "abs_", "(_", "cf_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fcf", "_", "=_", "min_", "(_", "cf_", ",_", "fcf", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "coefs_", "._", "append_", "(_", "fcf", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "coef_", ",_", "col_", "=_", "max_", "(_", "zip_", "(_", "coefs_", ",_", "remaining_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "\"", "addin", "g", " ", "column", ":", " ", "{", "col", "}\"_", "._", "format_", "(_", "col_", "=_", "col_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "curr_", "._", "append_", "(_", "col_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "remaining_", "=_", "remaining_", "._", "drop_", "(_", "[_", "col_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "list_", "(_", "curr_", ")_", "\\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_", "Las", "so", "Path", "Selector_", "(_", "Selector_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Las", "so", "Path", "Selector_", "(_", "Selector_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "sets_", "(_", "self_", ",_", "x_", ",_", "y_", ",_", "n", "\\u", "keep_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "alphas_", ",_", "active_", ",_", "coef\\u", "path_", "=_", "linear", "\\u", "model_", "._", "lars", "\\u", "path_", "(_", "x_", "._", "values_", ",_", "y_", "._", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sets_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "seen_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "coef\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "coefs_", "in_", "coef\\u", "path_", "._", "T_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cols_", "=_", "[_", "x_", "._", "columns_", "[_", "i_", "]_", "for_", "i_", "in_", "range_", "(_", "len_", "(_", "coefs_", ")_", ")_", "if_", "coefs_", "[_", "i_", "]_", ">_", "1e-", "9_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "cols_", ")_", ">=_", "n", "\\u", "keep_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cols_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "cols_", "\\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_", "Bin", "ary", "Feature", "Selector_", "(_", "Selector_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "On", "ly", " ", "for", " ", "classificati", "on", " ", "and", " ", "binar", "y", "(-", "able", ")", " ", "features", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Bin", "ary", "Feature", "Selector_", "(_", "Selector_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "type_", "=_", "'", "bn", "s", "'_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "type", " ", "in", " ", "('", "ig", "',", " ", "'", "bn", "s", "',", " ", "'", "acc", "')", "\\", "10", ";", " ", " ", " ", " ", "see", ":", " ", "jm", "lr", ".", "csa", "il", ".", "mit", ".", "edu", "/", "papers", "/", "volume", "3", "/", "forma", "n", "03", "a", "/", "forma", "n", "03", "a", ".", "pdf", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "type_", "=_", "type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "super_", "(_", "Bin", "ary", "Feature", "Selector_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bin", "ary", "Feature", "Selector_", "(_", "Selector_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "select_", "(_", "self_", ",_", "x_", ",_", "y_", ",_", "n", "\\u", "keep_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cnt", "s_", "=_", "y_", "._", "value", "\\u", "counts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "Comp", "uti", "ng", " ", "binar", "y", " ", "feature", " ", "score", "s", " ", "for", " ", "%", "d", " ", "features", "...\"_", "%_", "len_", "(_", "x_", "._", "columns_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "cnt", "s_", ")_", ">_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scores_", "=_", "self_", "._", "round", "\\u", "robi", "n_", "(_", "x_", ",_", "y_", ",_", "n", "\\u", "keep_", ")_", "\\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 ", " _", "scores_", "=_", "self_", "._", "rank_", "(_", "x_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scores_", "=_", "[_", "s_", "[_", "1_", "]_", "for_", "s_", "in_", "scores_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "logging_", "._", "debug_", "(_", "scores_", "[_", ":_", "200_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "scores_", "[_", ":_", "n", "\\u", "keep_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bin", "ary", "Feature", "Selector_", "(_", "Selector_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "round", "\\u", "robi", "n_", "(_", "self_", ",_", "x_", ",_", "y_", ",_", "n", "\\u", "keep_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Ensur", "es", " ", "all", " ", "classe", "s", " ", "get", " ", "representative", " ", "features", ",", " ", "not", " ", "just", " ", "tho", "se", " ", "with", " ", "strong", " ", "features", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vals_", "=_", "y_", "._", "unique_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scores_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "cls_", "in_", "vals_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scores_", "[_", "cls_", "]_", "=_", "self_", "._", "rank_", "(_", "x_", ",_", "np_", "._", "equal_", "(_", "cls_", ",_", "y_", ")_", "._", "astype_", "(_", "'", "Int64", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scores_", "[_", "cls_", "]_", "._", "reverse_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "keeper", "s_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "len_", "(_", "keeper", "s_", ")_", "<_", "n", "\\u", "keep_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "cls_", "in_", "vals_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keeper", "s_", "._", "add_", "(_", "scores_", "[_", "cls_", "]_", "._", "pop_", "(_", ")_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "list_", "(_", "keeper", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bin", "ary", "Feature", "Selector_", "(_", "Selector_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rank_", "(_", "self_", ",_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cnt", "s_", "=_", "y_", "._", "value", "\\u", "counts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scores_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "e_", "(_", "x_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "abs_", "(_", "y_", ")_", "<_", ".0000", "00001", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yx", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ly", "x_", "=_", "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 ", " _", "yx", "_", "=_", "y_", "/_", "(_", "x_", "+_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ly", "x_", "=_", "math_", "._", "log_", "(_", "y_", "/_", "(_", "x_", "+_", "y_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "abs_", "(_", "x_", ")_", "<_", ".0000", "00001", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "xy_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lx", "y_", "=_", "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 ", " _", "xy_", "=_", "x_", "/_", "(_", "x_", "+_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lx", "y_", "=_", "math_", "._", "log_", "(_", "x_", "/_", "(_", "x_", "+_", "y_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "-_", "xy_", "*_", "lx", "y_", "-_", "yx", "_", "*_", "ly", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "c_", "in_", "x_", "._", "columns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "true", "\\u", "positives", "_", "=_", "float_", "(_", "np_", "._", "count", "\\u", "nonzero_", "(_", "np_", "._", "logical", "\\u", "and_", "(_", "x_", "[_", "c_", "]_", ",_", "y_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fal", "se", "\\u", "positives", "_", "=_", "float_", "(_", "np_", "._", "count", "\\u", "nonzero_", "(_", "np_", "._", "logical", "\\u", "and_", "(_", "x_", "[_", "c_", "]_", ",_", "np_", "._", "logical", "\\u", "not_", "(_", "y_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "float_", "(_", "cnt", "s_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "neg_", "=_", "float_", "(_", "cnt", "s_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "pos_", "+_", "neg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "type_", "==_", "'", "bn", "s", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tpr", "_", "=_", "max_", "(_", "0.0005", "_", ",_", "true", "\\u", "positives", "_", "/_", "pos_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fpr", "_", "=_", "max_", "(_", "0.0005", "_", ",_", "fal", "se", "\\u", "positives", "_", "/_", "neg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tpr", "_", "=_", "min_", "(_", ".99", "95_", ",_", "tpr", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fpr", "_", "=_", "min_", "(_", ".99", "95_", ",_", "fpr", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score_", "=_", "abs_", "(_", "norm_", "._", "pp", "f_", "(_", "tpr", "_", ")_", "-_", "norm_", "._", "pp", "f_", "(_", "fpr", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "type_", "==_", "'", "acc", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "score_", "=_", "abs_", "(_", "tpr", "_", "-_", "fpr", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "type_", "==_", "'", "ig", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "score_", "=_", "e_", "(_", "pos_", ",_", "neg_", ")_", "-_", "(_", "(_", "true", "\\u", "positives", "_", "+_", "fal", "se", "\\u", "positives", "_", ")_", "/_", "n_", "*_", "e_", "(_", "true", "\\u", "positives", "_", ",_", "fal", "se", "\\u", "positives", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "+_", "(_", "1_", "-_", "(_", "true", "\\u", "positives", "_", "+_", "fal", "se", "\\u", "positives", "_", ")_", "/_", "n_", ")_", "*_", "e_", "(_", "pos_", "-_", "true", "\\u", "positives", "_", ",_", "neg_", "-_", "fal", "se", "\\u", "positives", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scores_", "._", "append_", "(_", "(_", "score_", ",_", "c_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scores_", "._", "sort_", "(_", "reverse_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "scores_", "\\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_", "Information", "Gain", "Selector_", "(_", "Selector_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "On", "ly", " ", "for", " ", "binar", "y", " ", "classificati", "on", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Information", "Gain", "Selector_", "(_", "Selector_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "sets_", "(_", "self_", ",_", "x_", ",_", "y_", ",_", "n", "\\u", "keep_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cnt", "s_", "=_", "y_", "._", "value", "\\u", "counts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "len_", "(_", "cnt", "s_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "info_", "(_", "\"", "Comp", "uti", "ng", " ", "IG", " ", "score", "s", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scores_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "x_", "._", "columns_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "true", "\\u", "positives", "_", "=_", "sum_", "(_", "np_", "._", "logical", "\\u", "and_", "(_", "x_", "[_", "c_", "]_", ",_", "y_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fal", "se", "\\u", "positives", "_", "=_", "sum_", "(_", "np_", "._", "logical", "\\u", "and_", "(_", "x_", "[_", "c_", "]_", ",_", "np_", "._", "logical", "\\u", "not_", "(_", "y_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "score_", "=_", "abs_", "(_", "norm_", "._", "pp", "f_", "(_", "true", "\\u", "positives", "_", "/_", "float_", "(_", "cnt", "s_", "[_", "1_", "]_", ")_", ")_", "-_", "norm_", "._", "pp", "f_", "(_", "fal", "se", "\\u", "positives", "_", "/_", "float_", "(_", "cnt", "s_", "[_", "0_", "]_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scores_", "._", "append_", "(_", "(_", "score_", ",_", "c_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "scores_", "._", "sort_", "(_", "reverse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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 ]
Signature mismatch in overriding method
cloudera/hue/desktop/core/ext-py/pysaml2-2.4.0/src/saml2/authn.py
[ { "content": "class UserAuthnMethod(object):\n\n\n", "metadata": "root.UserAuthnMethod", "header": "['module', '___EOS___']", "index": 27 }, { "content": " def __init__(self, srv):\n self.srv = srv", "metadata": "root.UserAuthnMethod.__init__", "header": "['class', 'UserAuthnMethod', '(', 'object', ')', ':', '___EOS___']", "index": 28 }, { "content": " def __call__(self, *args, **kwargs):\n raise NotImplemented", "metadata": "root.UserAuthnMethod.__call__", "header": "['class', 'UserAuthnMethod', '(', 'object', ')', ':', '___EOS___']", "index": 31 }, { "content": " def authenticated_as(self, **kwargs):\n raise NotImplemented", "metadata": "root.UserAuthnMethod.authenticated_as", "header": "['class', 'UserAuthnMethod', '(', 'object', ')', ':', '___EOS___']", "index": 34 }, { "content": " def verify(self, **kwargs):\n raise NotImplemented", "metadata": "root.UserAuthnMethod.verify", "header": "['class', 'UserAuthnMethod', '(', 'object', ')', ':', '___EOS___']", "index": 37 }, { "content": "class UsernamePasswordMako(UserAuthnMethod):\n \"\"\"Do user authentication using the normal username password form\n using Mako as template system\"\"\"\n cookie_name = \"userpassmako\"\n\n\n\n\n\n", "metadata": "root.UsernamePasswordMako", "header": "['module', '___EOS___']", "index": 103 }, { "content": " def __init__(self, srv, mako_template, template_lookup, pwd, return_to):\n \"\"\"\n :param srv: The server instance\n :param mako_template: Which Mako template to use\n :param pwd: Username/password dictionary like database\n :param return_to: Where to send the user after authentication\n :return:\n \"\"\"\n UserAuthnMethod.__init__(self, srv)\n self.mako_template = mako_template\n self.template_lookup = template_lookup\n self.passwd = pwd\n self.return_to = return_to\n self.active = {}\n self.query_param = \"upm_answer\"\n self.aes = AESCipher(self.srv.symkey, srv.iv)", "metadata": "root.UsernamePasswordMako.__init__", "header": "['class', 'UsernamePasswordMako', '(', 'UserAuthnMethod', ')', ':', '___EOS___']", "index": 108 }, { "content": " def __call__(self, cookie=None, policy_url=None, logo_url=None,\n query=\"\", **kwargs):\n \"\"\"\n Put up the login form\n \"\"\"\n if cookie:\n headers = [cookie]\n else:\n headers = []\n\n resp = Response(headers=headers)\n\n argv = {\"login\": \"\",\n \"password\": \"\",\n \"action\": \"verify\",\n \"policy_url\": policy_url,\n \"logo_url\": logo_url,\n \"query\": query}\n logger.info(\"do_authentication argv: %s\" % argv)\n mte = self.template_lookup.get_template(self.mako_template)\n resp.message = mte.render(**argv)\n return resp", "metadata": "root.UsernamePasswordMako.__call__", "header": "['class', 'UsernamePasswordMako', '(', 'UserAuthnMethod', ')', ':', '___EOS___']", "index": 125 }, { "content": " def _verify(self, pwd, user):\n assert is_equal(pwd, self.passwd[user])", "metadata": "root.UsernamePasswordMako._verify", "header": "['class', 'UsernamePasswordMako', '(', 'UserAuthnMethod', ')', ':', '___EOS___']", "index": 148 }, { "content": " def verify(self, request, **kwargs):\n \"\"\"\n Verifies that the given username and password was correct\n :param request: Either the query part of a URL a urlencoded\n body of a HTTP message or a parse such.\n :param kwargs: Catch whatever else is sent.\n :return: redirect back to where ever the base applications\n wants the user after authentication.\n \"\"\"\n\n #logger.debug(\"verify(%s)\" % request)\n if isinstance(request, basestring):\n _dict = parse_qs(request)\n elif isinstance(request, dict):\n _dict = request\n else:\n raise ValueError(\"Wrong type of input\")\n\n # verify username and password\n try:\n self._verify(_dict[\"password\"][0], _dict[\"login\"][0])\n timestamp = str(int(time.mktime(time.gmtime())))\n info = self.aes.encrypt(\"::\".join([_dict[\"login\"][0], timestamp]))\n self.active[info] = timestamp\n cookie = make_cookie(self.cookie_name, info, self.srv.seed)\n return_to = create_return_url(self.return_to, _dict[\"query\"][0],\n **{self.query_param: \"true\"})\n resp = Redirect(return_to, headers=[cookie])\n except (AssertionError, KeyError):\n resp = Unauthorized(\"Unknown user or wrong password\")\n\n return resp", "metadata": "root.UsernamePasswordMako.verify", "header": "['class', 'UsernamePasswordMako', '(', 'UserAuthnMethod', ')', ':', '___EOS___']", "index": 151 }, { "content": " def authenticated_as(self, cookie=None, **kwargs):\n if cookie is None:\n return None\n else:\n logger.debug(\"kwargs: %s\" % kwargs)\n try:\n info, timestamp = parse_cookie(self.cookie_name,\n self.srv.seed, cookie)\n if self.active[info] == timestamp:\n uid, _ts = self.aes.decrypt(info).split(\"::\")\n if timestamp == _ts:\n return {\"uid\": uid}\n except Exception:\n pass\n\n return None", "metadata": "root.UsernamePasswordMako.authenticated_as", "header": "['class', 'UsernamePasswordMako', '(', 'UserAuthnMethod', ')', ':', '___EOS___']", "index": 184 }, { "content": " def done(self, areq):\n try:\n _ = areq[self.query_param]\n return False\n except KeyError:\n return True", "metadata": "root.UsernamePasswordMako.done", "header": "['class', 'UsernamePasswordMako', '(', 'UserAuthnMethod', ')', ':', '___EOS___']", "index": 201 } ]
[ { "span": "def verify(self, request, **kwargs):", "start_line": 151, "start_column": 4, "end_line": 151, "end_column": 40 } ]
[ { "span": "def verify(self, **kwargs):", "start_line": 37, "start_column": 4, "end_line": 37, "end_column": 31 } ]
1
false
[ "[CLS]_", "Signature_", "mismatch_", "in_", "overrid", "ing_", "method_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "User", "Auth", "n", "Method_", "(_", "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_", "[SEP]_", "class_", "User", "Auth", "n", "Method_", "(_", "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_", ",_", "srv_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "srv_", "=_", "srv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Auth", "n", "Method_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Implemented_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Auth", "n", "Method_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "authenticat", "ed", "\\u", "as_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Implemented_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "Auth", "n", "Method_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "verify_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\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_", "class_", "User", "name", "Passw", "ord", "Ma", "ko", "_", "(_", "User", "Auth", "n", "Method_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Do", " ", "user", " ", "authenticat", "ion", " ", "usi", "ng", " ", "the", " ", "normal", " ", "user", "name", " ", "password", " ", "form", "\\", "10", ";", " ", " ", " ", " ", "usi", "ng", " ", "Ma", "ko", " ", "as", " ", "template", " ", "system", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cookie", "\\u", "name_", "=_", "\"", "userp", "ass", "mak", "o", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "User", "name", "Passw", "ord", "Ma", "ko", "_", "(_", "User", "Auth", "n", "Method_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "srv_", ",_", "mak", "o", "\\u", "template_", ",_", "template", "\\u", "lookup_", ",_", "pwd_", ",_", "return", "\\u", "to_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "srv", ":", " ", "The", " ", "server", " ", "instance", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "mak", "o", "\\u", "template", ":", " ", "Whi", "ch", " ", "Ma", "ko", " ", "template", " ", "to", " ", "use", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "pwd", ":", " ", "User", "name", "/", "password", " ", "dictionar", "y", " ", "like", " ", "databa", "se", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "return", "\\u", "to", ":", " ", "Whe", "re", " ", "to", " ", "send", " ", "the", " ", "user", " ", "after", " ", "authenticat", "ion", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "User", "Auth", "n", "Method_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "srv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "mak", "o", "\\u", "template_", "=_", "mak", "o", "\\u", "template_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "template", "\\u", "lookup_", "=_", "template", "\\u", "lookup_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "passwd_", "=_", "pwd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "return", "\\u", "to_", "=_", "return", "\\u", "to_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "active_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "query", "\\u", "param_", "=_", "\"", "up", "m", "\\u", "answer", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "aes", "_", "=_", "AE", "SC", "iph", "er_", "(_", "self_", "._", "srv_", "._", "sym", "key_", ",_", "srv_", "._", "iv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "name", "Passw", "ord", "Ma", "ko", "_", "(_", "User", "Auth", "n", "Method_", ")_", ":_", "\\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_", ",_", "cookie_", "=_", "None_", ",_", "policy", "\\u", "url_", "=_", "None_", ",_", "logo", "\\u", "url_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "query_", "=_", "\"\"_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Put", " ", "up", " ", "the", " ", "login", " ", "form", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "cookie_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "headers_", "=_", "[_", "cookie_", "]_", "\\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 ", " _", "headers_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "resp_", "=_", "Response_", "(_", "headers_", "=_", "headers_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "argv_", "=_", "{_", "\"", "login", "\"_", ":_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "password", "\"_", ":_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "action", "\"_", ":_", "\"", "verify", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "policy", "\\u", "url", "\"_", ":_", "policy", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "logo", "\\u", "url", "\"_", ":_", "logo", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "query", "\"_", ":_", "query_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "._", "info_", "(_", "\"", "do", "\\u", "authenticat", "ion", " ", "argv", ":", " ", "%", "s", "\"_", "%_", "argv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mte", "_", "=_", "self_", "._", "template", "\\u", "lookup_", "._", "get", "\\u", "template_", "(_", "self_", "._", "mak", "o", "\\u", "template_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "._", "message_", "=_", "mte", "_", "._", "render_", "(_", "**_", "argv_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "resp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "name", "Passw", "ord", "Ma", "ko", "_", "(_", "User", "Auth", "n", "Method_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "verify_", "(_", "self_", ",_", "pwd_", ",_", "user_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert_", "is", "\\u", "equal_", "(_", "pwd_", ",_", "self_", "._", "passwd_", "[_", "user_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "name", "Passw", "ord", "Ma", "ko", "_", "(_", "User", "Auth", "n", "Method_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "verify_", "(_", "self_", ",_", "request_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Verifie", "s", " ", "tha", "t", " ", "the", " ", "give", "n", " ", "user", "name", " ", "and", " ", "password", " ", "was", " ", "correct", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "request", ":", " ", "Ei", "ther", " ", "the", " ", "query", " ", "part", " ", "of", " ", "a", " ", "URL", " ", "a", " ", "url", "encode", "d", "\\", "10", ";", " ", " ", " ", " ", "body", " ", "of", " ", "a", " ", "HTTP", " ", "message", " ", "or", " ", "a", " ", "parse", " ", "suc", "h", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "param", " ", "kwarg", "s", ":", " ", "Catch", " ", "what", "ever", " ", "else", " ", "is", " ", "sent", ".", "\\", "10", ";", " ", " ", " ", " ", ":", "return", ":", " ", "redirec", "t", " ", "back", " ", "to", " ", "where", " ", "ever", " ", "the", " ", "base", " ", "applica", "tion", "s", "\\", "10", ";", " ", " ", " ", " ", "want", "s", " ", "the", " ", "user", " ", "after", " ", "authenticat", "ion", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "logg", "er", ".", "debug", "(\"", "verify", "(%", "s", ")\"", " ", "%", " ", "request", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "isinstance_", "(_", "request_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "dict_", "=_", "parse", "\\u", "qs_", "(_", "request_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "request_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "dict_", "=_", "request_", "\\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_", "(_", "\"", "Wro", "ng", " ", "type", " ", "of", " ", "input", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "verify", " ", "user", "name", " ", "and", " ", "password_", "\\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 ", " _", "self_", "._", "\\u", "verify_", "(_", "\\u", "dict_", "[_", "\"", "password", "\"_", "]_", "[_", "0_", "]_", ",_", "\\u", "dict_", "[_", "\"", "login", "\"_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "timestamp_", "=_", "str_", "(_", "int_", "(_", "time_", "._", "mktime_", "(_", "time_", "._", "gmtime_", "(_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "info_", "=_", "self_", "._", "aes", "_", "._", "encrypt_", "(_", "\":", ":\"_", "._", "join_", "(_", "[_", "\\u", "dict_", "[_", "\"", "login", "\"_", "]_", "[_", "0_", "]_", ",_", "timestamp_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "active_", "[_", "info_", "]_", "=_", "timestamp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cookie_", "=_", "make", "\\u", "cookie_", "(_", "self_", "._", "cookie", "\\u", "name_", ",_", "info_", ",_", "self_", "._", "srv_", "._", "seed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return", "\\u", "to_", "=_", "create", "\\u", "return", "\\u", "url_", "(_", "self_", "._", "return", "\\u", "to_", ",_", "\\u", "dict_", "[_", "\"", "query", "\"_", "]_", "[_", "0_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "{_", "self_", "._", "query", "\\u", "param_", ":_", "\"", "true", "\"_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resp_", "=_", "Redirect_", "(_", "return", "\\u", "to_", ",_", "headers_", "=_", "[_", "cookie_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Assert", "ion", "Error_", ",_", "Key", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "resp_", "=_", "Unauthorized_", "(_", "\"", "Un", "know", "n", " ", "user", " ", "or", " ", "wrong", " ", "password", "\"_", ")_", "\\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_", "[SEP]_", "class_", "User", "name", "Passw", "ord", "Ma", "ko", "_", "(_", "User", "Auth", "n", "Method_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "authenticat", "ed", "\\u", "as_", "(_", "self_", ",_", "cookie_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "cookie_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logger_", "._", "debug_", "(_", "\"", "kwarg", "s", ":", " ", "%", "s", "\"_", "%_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "info_", ",_", "timestamp_", "=_", "parse", "\\u", "cookie_", "(_", "self_", "._", "cookie", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "srv_", "._", "seed_", ",_", "cookie_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "active_", "[_", "info_", "]_", "==_", "timestamp_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "uid_", ",_", "\\u", "ts_", "=_", "self_", "._", "aes", "_", "._", "decrypt_", "(_", "info_", ")_", "._", "split_", "(_", "\":", ":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "timestamp_", "==_", "\\u", "ts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "return_", "{_", "\"", "uid", "\"_", ":_", "uid_", "}_", "\\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_", "Exception_", ":_", "\\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_", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "User", "name", "Passw", "ord", "Ma", "ko", "_", "(_", "User", "Auth", "n", "Method_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "done_", "(_", "self_", ",_", "are", "q_", ")_", ":_", "\\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 ", " _", "\\u_", "=_", "are", "q_", "[_", "self_", "._", "query", "\\u", "param_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "True_", "\\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, 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, 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,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Except block handles 'BaseException'
igordejanovic/textX/textx/textx.py
[ { "content": "def str_match_SA(parser, node, children):\n try:\n to_match = children[0]\n except:\n to_match = ''\n\n # Support for autokwd metamodel param.\n if parser.metamodel.autokwd:\n match = parser.keyword_regex.match(to_match)\n if match and match.span() == (0, len(to_match)):\n regex_match = RegExMatch(r'{}\\b'.format(to_match),\n ignore_case=parser.metamodel.ignore_case,\n str_repr=to_match)\n regex_match.compile()\n return regex_match\n return StrMatch(to_match, ignore_case=parser.metamodel.ignore_case)", "metadata": "root.str_match_SA", "header": "['module', '___EOS___']", "index": 692 }, { "content": "def re_match_SA(parser, node, children):\n try:\n to_match = children[0]\n except:\n to_match = ''\n regex = RegExMatch(to_match, ignore_case=parser.metamodel.ignore_case)\n try:\n regex.compile()\n except Exception as e:\n line, col = parser.pos_to_linecol(node[1].position)\n raise TextXSyntaxError(\n \"{} at {}\"\n .format(text(e), text((line, col))), line, col)\n return regex", "metadata": "root.re_match_SA", "header": "['module', '___EOS___']", "index": 711 } ]
[ { "span": "except:", "start_line": 695, "start_column": 4, "end_line": 695, "end_column": 11 }, { "span": "except:", "start_line": 714, "start_column": 4, "end_line": 714, "end_column": 11 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "str", "\\u", "match", "\\u", "SA", "_", "(_", "parser_", ",_", "node_", ",_", "children_", ")_", ":_", "\\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 ", " _", "to", "\\u", "match_", "=_", "children_", "[_", "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 ", " _", "to", "\\u", "match_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Supp", "ort", " ", "for", " ", "auto", "kwd", " ", "meta", "model", " ", "param", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "parser_", "._", "meta", "model_", "._", "auto", "kwd", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "match_", "=_", "parser_", "._", "keyw", "ord", "\\u", "regex_", "._", "match_", "(_", "to", "\\u", "match_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", "and_", "match_", "._", "span_", "(_", ")_", "==_", "(_", "0_", ",_", "len_", "(_", "to", "\\u", "match_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "regex", "\\u", "match_", "=_", "Reg", "Ex", "Match_", "(_", "r", "'{}", "\\\\", "b", "'_", "._", "format_", "(_", "to", "\\u", "match_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ignore", "\\u", "case_", "=_", "parser_", "._", "meta", "model_", "._", "ignore", "\\u", "case_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str", "\\u", "repr_", "=_", "to", "\\u", "match_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "regex", "\\u", "match_", "._", "compile_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "regex", "\\u", "match_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "Str", "Match_", "(_", "to", "\\u", "match_", ",_", "ignore", "\\u", "case_", "=_", "parser_", "._", "meta", "model_", "._", "ignore", "\\u", "case_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "re", "\\u", "match", "\\u", "SA", "_", "(_", "parser_", ",_", "node_", ",_", "children_", ")_", ":_", "\\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 ", " _", "to", "\\u", "match_", "=_", "children_", "[_", "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 ", " _", "to", "\\u", "match_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "regex_", "=_", "Reg", "Ex", "Match_", "(_", "to", "\\u", "match_", ",_", "ignore", "\\u", "case_", "=_", "parser_", "._", "meta", "model_", "._", "ignore", "\\u", "case_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "regex_", "._", "compile_", "(_", ")_", "\\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 ", " _", "line_", ",_", "col_", "=_", "parser_", "._", "pos", "\\u", "to", "\\u", "lineco", "l_", "(_", "node_", "[_", "1_", "]_", "._", "position_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Text", "XS", "yn", "tax", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"{}", " ", "at", " ", "{}\"_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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 ]
Imprecise assert
bloomreach/briefly/tests/briefly/test_dag.py
[ { "content": " def test_no_attrs(self):\n graph_node = GraphNode()\n self.assertTrue(hasattr(graph_node, 'parents'))\n self.assertTrue(hasattr(graph_node, 'children'))\n self.assertTrue(graph_node.attributes is None)\n dummy_key = 1\n key = graph_node.unpack(dummy_key)\n self.assertTrue(key == dummy_key)", "metadata": "root.TestGraphNode.test_no_attrs", "header": "['class', 'TestGraphNode', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 23 }, { "content": " def test_attrs(self):\n graph_node = GraphNode(self.myattrs)\n self.assertTrue(len(graph_node.attributes) == 1)\n self.assertTrue(graph_node.attributes['attr'] == 1)", "metadata": "root.TestGraphNode.test_attrs", "header": "['class', 'TestGraphNode', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 32 }, { "content": " def test_int_attrs(self):\n metadata = 3\n graph_node = GraphNode(metadata)\n self.assertTrue( graph_node.attributes == metadata)\n dummy_key = 1\n key, attrs = graph_node.unpack(dummy_key)\n self.assertTrue(attrs == metadata)\n self.assertTrue(key == dummy_key)", "metadata": "root.TestGraphNode.test_int_attrs", "header": "['class', 'TestGraphNode', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 37 }, { "content": " def test_nodes(self):\n wait = False\n self.assertTrue(len(self.g) == 3)\n for n in self.nodes:\n self.assertTrue(n in self.g)\n for n in self.g.nodes:\n self.assertTrue(n in self.nodes)\n self.g.remove(2)\n self.assertTrue(1 in self.g)\n self.assertTrue(3 in self.g)\n self.assertFalse(2 in self.g)\n self.assertFalse(4 in self.g)\n self.assertTrue(len(self.g) == 2)\n self.assertFalse(self.g.is_empty())\n self.g.remove(1)\n self.g.remove(3)\n self.assertTrue(self.g.is_empty())", "metadata": "root.TestCaseIslands.test_nodes", "header": "['class', 'TestCaseIslands', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 66 }, { "content": " def _test_bridge_nodes(self, iterable):\n for x in iterable:\n bridge_nodes = list(self.g.get_bridge_nodes(x))\n self.assertTrue(len(bridge_nodes) == 1)\n self.assertTrue(bridge_nodes[0] == x+1)", "metadata": "root.TestCaseSanity._test_bridge_nodes", "header": "['class', 'TestCaseSanity', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 99 }, { "content": " def _test_node_exists(self, iterable):\n for x in iterable:\n self.assertTrue(x in self.g)", "metadata": "root.TestCaseSanity._test_node_exists", "header": "['class', 'TestCaseSanity', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 105 }, { "content": " def test_remove(self):\n for s in xrange(1, 5):\n self.assertTrue(s in self.g)\n self.g.remove(s)\n self.assertFalse(s in self.g)\n # make sure other nodes are still there. \n self._test_node_exists(xrange(s+1,7))\n self._test_bridge_nodes(xrange(s+1,5))", "metadata": "root.TestCaseSanity.test_remove", "header": "['class', 'TestCaseSanity', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 124 }, { "content": " def test_remove_middle(self):\n self.assertTrue(2 in self.g)\n self.g.remove(2)\n self.assertFalse(2 in self.g)\n self.assertTrue(1 in self.g)\n self.assertFalse(self.g.has_child(1))\n for n in xrange(3,7):\n self.assertTrue(n in self.g)\n for x in xrange(3,6):\n self.assertTrue(self.g.has_child(x))", "metadata": "root.TestCaseSanity.test_remove_middle", "header": "['class', 'TestCaseSanity', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 133 }, { "content": " def test_start_nodes(self):\n start_nodes = set(self.g.get_start_nodes())\n self.assertTrue(len(start_nodes)==3)\n for x in xrange(1,6,2):\n self.assertTrue(x in start_nodes)", "metadata": "root.TestCaseParallel.test_start_nodes", "header": "['class', 'TestCaseParallel', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 159 }, { "content": " def test_bridge_nodes(self):\n # bridges nodes of 1,3,5 are 2,4,6 respectively.\n for x in xrange(1,6,2):\n bnodes = list(self.g.get_bridge_nodes(x))\n self.assertTrue(len(bnodes)==1)\n self.assertTrue(x+1 == bnodes[0])\n # no bridge nodes for 2,4,6\n for x in xrange(2,7,2):\n bnodes = list(self.g.get_bridge_nodes(x))\n self.assertTrue(len(bnodes)==0)", "metadata": "root.TestCaseParallel.test_bridge_nodes", "header": "['class', 'TestCaseParallel', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 165 }, { "content": " def test_attribute(self):\n for n, attr in self.g.nodes:\n self.assertTrue(attr['name'] == n)", "metadata": "root.TestAttributeGraph.test_attribute", "header": "['class', 'TestAttributeGraph', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 187 }, { "content": " def test_start_nodes(self):\n start_nodes = list(self.g.get_start_nodes())\n self.assertTrue(len(start_nodes)==1)\n node, attr = start_nodes[0]\n self.assertTrue(node == 1)\n self.assertTrue(node == 1)", "metadata": "root.TestAttributeGraph.test_start_nodes", "header": "['class', 'TestAttributeGraph', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 191 }, { "content": " def test_bridge_nodes(self):\n bridge_nodes = list(self.g.get_bridge_nodes(1))\n self.assertTrue(len(bridge_nodes)==1)\n node, attr = bridge_nodes[0]\n self.assertTrue(node== 2)\n self.assertTrue(attr['name'] == 2)", "metadata": "root.TestAttributeGraph.test_bridge_nodes", "header": "['class', 'TestAttributeGraph', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 198 }, { "content": " def test_properties(self):\n for n, prop in self.g.nodes:\n self.assertTrue(prop.name == n)", "metadata": "root.TestPropertiesGraph.test_properties", "header": "['class', 'TestPropertiesGraph', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 216 }, { "content": " def test_bridge_nodes(self):\n bridge_nodes = list(self.g.get_bridge_nodes(1))\n self.assertTrue(len(bridge_nodes)==1)\n node, prop = bridge_nodes[0]\n self.assertTrue(prop.name == 2)", "metadata": "root.TestPropertiesGraph.test_bridge_nodes", "header": "['class', 'TestPropertiesGraph', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 220 } ]
[ { "span": "self.assertTrue(graph_node.attributes is None)", "start_line": 27, "start_column": 4, "end_line": 27, "end_column": 50 }, { "span": "self.assertTrue(key == dummy_key)", "start_line": 30, "start_column": 4, "end_line": 30, "end_column": 37 }, { "span": "self.assertTrue(len(graph_node.attributes) == 1)", "start_line": 34, "start_column": 4, "end_line": 34, "end_column": 52 }, { "span": "self.assertTrue(graph_node.attributes['attr'] == 1)", "start_line": 35, "start_column": 4, "end_line": 35, "end_column": 55 }, { "span": "self.assertTrue( graph_node.attributes == metadata)", "start_line": 40, "start_column": 4, "end_line": 40, "end_column": 55 }, { "span": "self.assertTrue(attrs == metadata)", "start_line": 43, "start_column": 4, "end_line": 43, "end_column": 38 }, { "span": "self.assertTrue(key == dummy_key)", "start_line": 44, "start_column": 4, "end_line": 44, "end_column": 37 }, { "span": "self.assertTrue(len(self.g) == 3)", "start_line": 68, "start_column": 4, "end_line": 68, "end_column": 37 }, { "span": "self.assertTrue(n in self.g)", "start_line": 70, "start_column": 6, "end_line": 70, "end_column": 34 }, { "span": "self.assertTrue(n in self.nodes)", "start_line": 72, "start_column": 6, "end_line": 72, "end_column": 38 }, { "span": "self.assertTrue(1 in self.g)", "start_line": 74, "start_column": 4, "end_line": 74, "end_column": 32 }, { "span": "self.assertTrue(3 in self.g)", "start_line": 75, "start_column": 4, "end_line": 75, "end_column": 32 }, { "span": "self.assertFalse(2 in self.g)", "start_line": 76, "start_column": 4, "end_line": 76, "end_column": 33 }, { "span": "self.assertFalse(4 in self.g)", "start_line": 77, "start_column": 4, "end_line": 77, "end_column": 33 }, { "span": "self.assertTrue(len(self.g) == 2)", "start_line": 78, "start_column": 4, "end_line": 78, "end_column": 37 }, { "span": "self.assertTrue(len(bridge_nodes) == 1)", "start_line": 102, "start_column": 6, "end_line": 102, "end_column": 45 }, { "span": "self.assertTrue(bridge_nodes[0] == x+1)", "start_line": 103, "start_column": 6, "end_line": 103, "end_column": 45 }, { "span": "self.assertTrue(x in self.g)", "start_line": 107, "start_column": 6, "end_line": 107, "end_column": 34 }, { "span": "self.assertTrue(s in self.g)", "start_line": 126, "start_column": 6, "end_line": 126, "end_column": 34 }, { "span": "self.assertFalse(s in self.g)", "start_line": 128, "start_column": 6, "end_line": 128, "end_column": 35 }, { "span": "self.assertTrue(2 in self.g)", "start_line": 134, "start_column": 4, "end_line": 134, "end_column": 32 }, { "span": "self.assertFalse(2 in self.g)", "start_line": 136, "start_column": 4, "end_line": 136, "end_column": 33 }, { "span": "self.assertTrue(1 in self.g)", "start_line": 137, "start_column": 4, "end_line": 137, "end_column": 32 }, { "span": "self.assertTrue(n in self.g)", "start_line": 140, "start_column": 6, "end_line": 140, "end_column": 34 }, { "span": "self.assertTrue(len(start_nodes)==3)", "start_line": 161, "start_column": 4, "end_line": 161, "end_column": 40 }, { "span": "self.assertTrue(x in start_nodes)", "start_line": 163, "start_column": 6, "end_line": 163, "end_column": 39 }, { "span": "self.assertTrue(len(bnodes)==1)", "start_line": 169, "start_column": 6, "end_line": 169, "end_column": 37 }, { "span": "self.assertTrue(x+1 == bnodes[0])", "start_line": 170, "start_column": 6, "end_line": 170, "end_column": 39 }, { "span": "self.assertTrue(len(bnodes)==0)", "start_line": 174, "start_column": 6, "end_line": 174, "end_column": 37 }, { "span": "self.assertTrue(attr['name'] == n)", "start_line": 189, "start_column": 6, "end_line": 189, "end_column": 40 }, { "span": "self.assertTrue(len(start_nodes)==1)", "start_line": 193, "start_column": 4, "end_line": 193, "end_column": 40 }, { "span": "self.assertTrue(node == 1)", "start_line": 195, "start_column": 4, "end_line": 195, "end_column": 30 }, { "span": "self.assertTrue(node == 1)", "start_line": 196, "start_column": 4, "end_line": 196, "end_column": 30 }, { "span": "self.assertTrue(len(bridge_nodes)==1)", "start_line": 200, "start_column": 4, "end_line": 200, "end_column": 41 }, { "span": "self.assertTrue(node== 2)", "start_line": 202, "start_column": 4, "end_line": 202, "end_column": 29 }, { "span": "self.assertTrue(attr['name'] == 2)", "start_line": 203, "start_column": 4, "end_line": 203, "end_column": 38 }, { "span": "self.assertTrue(prop.name == n)", "start_line": 218, "start_column": 6, "end_line": 218, "end_column": 37 }, { "span": "self.assertTrue(len(bridge_nodes)==1)", "start_line": 222, "start_column": 4, "end_line": 222, "end_column": 41 }, { "span": "self.assertTrue(prop.name == 2)", "start_line": 224, "start_column": 4, "end_line": 224, "end_column": 35 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Graph", "Node_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "no", "\\u", "attrs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "graph", "\\u", "node_", "=_", "Graph", "Node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "graph", "\\u", "node_", ",_", "'", "parents", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "hasattr_", "(_", "graph", "\\u", "node_", ",_", "'", "child", "ren", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph", "\\u", "node_", "._", "attributes_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dummy", "\\u", "key_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", "=_", "graph", "\\u", "node_", "._", "unpack_", "(_", "dummy", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "key_", "==_", "dummy", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Graph", "Node_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "attrs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "graph", "\\u", "node_", "=_", "Graph", "Node_", "(_", "self_", "._", "mya", "ttr", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "graph", "\\u", "node_", "._", "attributes_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph", "\\u", "node_", "._", "attributes_", "[_", "'", "attr", "'_", "]_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Graph", "Node_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "int\\u", "attrs_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "metadata_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "graph", "\\u", "node_", "=_", "Graph", "Node_", "(_", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "graph", "\\u", "node_", "._", "attributes_", "==_", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dummy", "\\u", "key_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key_", ",_", "attrs_", "=_", "graph", "\\u", "node_", "._", "unpack_", "(_", "dummy", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "attrs_", "==_", "metadata_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "key_", "==_", "dummy", "\\u", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Case", "Isl", "ands", "_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "nodes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wait_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "self_", "._", "g_", ")_", "==_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "n_", "in_", "self_", "._", "nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "n_", "in_", "self_", "._", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "n_", "in_", "self_", "._", "g_", "._", "nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "n_", "in_", "self_", "._", "nodes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "g_", "._", "remove_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "1_", "in_", "self_", "._", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "3_", "in_", "self_", "._", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "2_", "in_", "self_", "._", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "4_", "in_", "self_", "._", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "self_", "._", "g_", ")_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "self_", "._", "g_", "._", "is", "\\u", "empty_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "g_", "._", "remove_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "g_", "._", "remove_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "self_", "._", "g_", "._", "is", "\\u", "empty_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Case", "Sanit", "y_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "test\\u", "bridge", "\\u", "nodes_", "(_", "self_", ",_", "iterable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "x_", "in_", "iterable_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bridge", "\\u", "nodes_", "=_", "list_", "(_", "self_", "._", "g_", "._", "get", "\\u", "bridge", "\\u", "nodes_", "(_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "bridge", "\\u", "nodes_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "bridge", "\\u", "nodes_", "[_", "0_", "]_", "==_", "x_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Case", "Sanit", "y_", "(_", "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_", "\\u", "test\\u", "node", "\\u", "exists_", "(_", "self_", ",_", "iterable_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "x_", "in_", "iterable_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "x_", "in_", "self_", "._", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Case", "Sanit", "y_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "remove_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "s_", "in_", "xrange_", "(_", "1_", ",_", "5_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "s_", "in_", "self_", "._", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "g_", "._", "remove_", "(_", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "s_", "in_", "self_", "._", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "other", " ", "nodes", " ", "are", " ", "still", " ", "there", ".", " _", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u", "test\\u", "node", "\\u", "exists_", "(_", "xrange_", "(_", "s_", "+_", "1_", ",_", "7_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "test\\u", "bridge", "\\u", "nodes_", "(_", "xrange_", "(_", "s_", "+_", "1_", ",_", "5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Case", "Sanit", "y_", "(_", "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", "remove", "\\u", "middle_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "2_", "in_", "self_", "._", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "g_", "._", "remove_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "2_", "in_", "self_", "._", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "1_", "in_", "self_", "._", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "self_", "._", "g_", "._", "has", "\\u", "child_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "n_", "in_", "xrange_", "(_", "3_", ",_", "7_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "n_", "in_", "self_", "._", "g_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "3_", ",_", "6_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "self_", "._", "g_", "._", "has", "\\u", "child_", "(_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Case", "Parallel", "_", "(_", "unittest_", "._", "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", "nodes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "nodes_", "=_", "set_", "(_", "self_", "._", "g_", "._", "get", "\\u", "start", "\\u", "nodes_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "start", "\\u", "nodes_", ")_", "==_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "1_", ",_", "6_", ",_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "x_", "in_", "start", "\\u", "nodes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Case", "Parallel", "_", "(_", "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", "bridge", "\\u", "nodes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "bridge", "s", " ", "nodes", " ", "of", " ", "1", ",", "3", ",", "5", " ", "are", " ", "2", ",", "4", ",", "6", " ", "respec", "tiv", "el", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "x_", "in_", "xrange_", "(_", "1_", ",_", "6_", ",_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bn", "odes_", "=_", "list_", "(_", "self_", "._", "g_", "._", "get", "\\u", "bridge", "\\u", "nodes_", "(_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "bn", "odes_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "x_", "+_", "1_", "==_", "bn", "odes_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "no", " ", "bridge", " ", "nodes", " ", "for", " ", "2", ",", "4", ",", "6_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "x_", "in_", "xrange_", "(_", "2_", ",_", "7_", ",_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bn", "odes_", "=_", "list_", "(_", "self_", "._", "g_", "._", "get", "\\u", "bridge", "\\u", "nodes_", "(_", "x_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "bn", "odes_", ")_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Attribute", "Graph_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "attribute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "n_", ",_", "attr_", "in_", "self_", "._", "g_", "._", "nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "attr_", "[_", "'", "name", "'_", "]_", "==_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Attribute", "Graph_", "(_", "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", "start", "\\u", "nodes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start", "\\u", "nodes_", "=_", "list_", "(_", "self_", "._", "g_", "._", "get", "\\u", "start", "\\u", "nodes_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "start", "\\u", "nodes_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node_", ",_", "attr_", "=_", "start", "\\u", "nodes_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "node_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "node_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Attribute", "Graph_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "bridge", "\\u", "nodes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bridge", "\\u", "nodes_", "=_", "list_", "(_", "self_", "._", "g_", "._", "get", "\\u", "bridge", "\\u", "nodes_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "bridge", "\\u", "nodes_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node_", ",_", "attr_", "=_", "bridge", "\\u", "nodes_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "node_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "attr_", "[_", "'", "name", "'_", "]_", "==_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Proper", "ties", "Graph_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "properties_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "n_", ",_", "prop_", "in_", "self_", "._", "g_", "._", "nodes_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "prop_", "._", "name_", "==_", "n_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Proper", "ties", "Graph_", "(_", "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", "bridge", "\\u", "nodes_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bridge", "\\u", "nodes_", "=_", "list_", "(_", "self_", "._", "g_", "._", "get", "\\u", "bridge", "\\u", "nodes_", "(_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "len_", "(_", "bridge", "\\u", "nodes_", ")_", "==_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node_", ",_", "prop_", "=_", "bridge", "\\u", "nodes_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "prop_", "._", "name_", "==_", "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, 0, 1, 1, 1, 1, 1, 1,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 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, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 ]
Unreachable code
saltstack/salt/salt/client/ssh/__init__.py
[ { "content": " def run_wfunc(self):\n '''\n Execute a wrapper function\n\n Returns tuple of (json_data, '')\n '''\n # Ensure that opts/grains are up to date\n # Execute routine\n data_cache = False\n data = None\n cdir = os.path.join(self.opts['cachedir'], 'minions', self.id)\n if not os.path.isdir(cdir):\n os.makedirs(cdir)\n datap = os.path.join(cdir, 'ssh_data.p')\n refresh = False\n if not os.path.isfile(datap):\n refresh = True\n else:\n passed_time = (time.time() - os.stat(datap).st_mtime) / 60\n if passed_time > self.opts.get('cache_life', 60):\n refresh = True\n\n if self.opts.get('refresh_cache'):\n refresh = True\n conf_grains = {}\n # Save conf file grains before they get clobbered\n if 'ssh_grains' in self.opts:\n conf_grains = self.opts['ssh_grains']\n if not data_cache:\n refresh = True\n if refresh:\n # Make the datap\n # TODO: Auto expire the datap\n pre_wrapper = salt.client.ssh.wrapper.FunctionWrapper(\n self.opts,\n self.id,\n fsclient=self.fsclient,\n minion_opts=self.minion_opts,\n **self.target)\n opts_pkg = pre_wrapper['test.opts_pkg']() # pylint: disable=E1102\n opts_pkg['file_roots'] = self.opts['file_roots']\n opts_pkg['pillar_roots'] = self.opts['pillar_roots']\n opts_pkg['ext_pillar'] = self.opts['ext_pillar']\n opts_pkg['extension_modules'] = self.opts['extension_modules']\n opts_pkg['_ssh_version'] = self.opts['_ssh_version']\n opts_pkg['__master_opts__'] = self.context['master_opts']\n if '_caller_cachedir' in self.opts:\n opts_pkg['_caller_cachedir'] = self.opts['_caller_cachedir']\n else:\n opts_pkg['_caller_cachedir'] = self.opts['cachedir']\n # Use the ID defined in the roster file\n opts_pkg['id'] = self.id\n\n retcode = 0\n\n if '_error' in opts_pkg:\n #Refresh failed\n retcode = opts_pkg['retcode']\n ret = json.dumps({'local': opts_pkg['_error']})\n return ret, retcode\n\n pillar = salt.pillar.Pillar(\n opts_pkg,\n opts_pkg['grains'],\n opts_pkg['id'],\n opts_pkg.get('environment', 'base')\n )\n pillar_dirs = {}\n pillar_data = pillar.compile_pillar(pillar_dirs=pillar_dirs)\n\n # TODO: cache minion opts in datap in master.py\n data = {'opts': opts_pkg,\n 'grains': opts_pkg['grains'],\n 'pillar': pillar_data}\n if data_cache:\n with salt.utils.fopen(datap, 'w+b') as fp_:\n fp_.write(\n self.serial.dumps(data)\n )\n if not data and data_cache:\n with salt.utils.fopen(datap, 'rb') as fp_:\n data = self.serial.load(fp_)\n opts = data.get('opts', {})\n opts['grains'] = data.get('grains')\n\n # Restore master grains\n for grain in conf_grains:\n opts['grains'][grain] = conf_grains[grain]\n # Enable roster grains support\n if 'grains' in self.target:\n for grain in self.target['grains']:\n opts['grains'][grain] = self.target['grains'][grain]\n\n opts['pillar'] = data.get('pillar')\n wrapper = salt.client.ssh.wrapper.FunctionWrapper(\n opts,\n self.id,\n fsclient=self.fsclient,\n minion_opts=self.minion_opts,\n **self.target)\n self.wfuncs = salt.loader.ssh_wrapper(opts, wrapper, self.context)\n wrapper.wfuncs = self.wfuncs\n\n # We're running in the mind, need to fetch the arguments from the\n # roster, pillar, master config (in that order)\n if self.mine:\n mine_args = None\n if self.mine_functions and self.fun in self.mine_functions:\n mine_args = self.mine_functions[self.fun]\n elif opts['pillar'] and self.fun in opts['pillar'].get('mine_functions', {}):\n mine_args = opts['pillar']['mine_functions'][self.fun]\n elif self.fun in self.context['master_opts'].get('mine_functions', {}):\n mine_args = self.context['master_opts']['mine_functions'][self.fun]\n\n # If we found mine_args, replace our command's args\n if isinstance(mine_args, dict):\n self.args = []\n self.kwargs = mine_args\n elif isinstance(mine_args, list):\n self.args = mine_args\n self.kwargs = {}\n\n try:\n if self.mine:\n result = wrapper[self.fun](*self.args, **self.kwargs)\n else:\n result = self.wfuncs[self.fun](*self.args, **self.kwargs)\n except TypeError as exc:\n result = 'TypeError encountered executing {0}: {1}'.format(self.fun, exc)\n log.error(result, exc_info_on_loglevel=logging.DEBUG)\n retcode = 1\n except Exception as exc:\n result = 'An Exception occurred while executing {0}: {1}'.format(self.fun, exc)\n log.error(result, exc_info_on_loglevel=logging.DEBUG)\n retcode = 1\n # Mimic the json data-structure that \"salt-call --local\" will\n # emit (as seen in ssh_py_shim.py)\n if isinstance(result, dict) and 'local' in result:\n ret = json.dumps({'local': result['local']})\n else:\n ret = json.dumps({'local': {'return': result}})\n return ret, retcode", "metadata": "root.Single.run_wfunc", "header": "['class', 'Single', '(', 'object', ')', ':', '___EOS___']", "index": 812 } ]
[ { "span": "with salt.utils.fopen(datap, 'w+b') as fp_:", "start_line": 887, "start_column": 16, "end_line": 887, "end_column": 59 }, { "span": "with salt.utils.fopen(datap, 'rb') as fp_:", "start_line": 892, "start_column": 12, "end_line": 892, "end_column": 54 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Single_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run", "\\u", "wf", "unc_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Execut", "e", " ", "a", " ", "wrapp", "er", " ", "function", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "tuple", " ", "of", " ", "(", "json", "\\u", "data", ",", " ", "''", ")", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ensur", "e", " ", "tha", "t", " ", "opts", "/", "grains", " ", "are", " ", "up", " ", "to", " ", "date_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Execut", "e", " ", "routine_", "\\u\\u\\uNL\\u\\u\\u_", "data\\u", "cache_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cdi", "r_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "opts_", "[_", "'", "cachedir", "'_", "]_", ",_", "'", "minion", "s", "'_", ",_", "self_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "isdir_", "(_", "cdi", "r_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "makedirs_", "(_", "cdi", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "datap", "_", "=_", "os_", "._", "path_", "._", "join_", "(_", "cdi", "r_", ",_", "'", "ssh", "\\u", "data", ".", "p", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "refresh_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "os_", "._", "path_", "._", "isfile_", "(_", "datap", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "refresh_", "=_", "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 ", " _", "pass", "ed", "\\u", "time_", "=_", "(_", "time_", "._", "time_", "(_", ")_", "-_", "os_", "._", "stat_", "(_", "datap", "_", ")_", "._", "st", "\\u", "mtime_", ")_", "/_", "60_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pass", "ed", "\\u", "time_", ">_", "self_", "._", "opts_", "._", "get_", "(_", "'", "cache", "\\u", "life", "'_", ",_", "60_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "refresh_", "=_", "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_", "if_", "self_", "._", "opts_", "._", "get_", "(_", "'", "refre", "sh", "\\u", "cache", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "refresh_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "conf", "\\u", "grains", "_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Save", " ", "conf", " ", "file", " ", "grains", " ", "bef", "ore", " ", "the", "y", " ", "get", " ", "clobber", "ed_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'", "ssh", "\\u", "grains", "'_", "in_", "self_", "._", "opts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conf", "\\u", "grains", "_", "=_", "self_", "._", "opts_", "[_", "'", "ssh", "\\u", "grains", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "data\\u", "cache_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "refresh_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "refresh_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Make", " ", "the", " ", "datap", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Auto", " ", "expir", "e", " ", "the", " ", "datap", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pre", "\\u", "wrapper_", "=_", "salt_", "._", "client_", "._", "ssh_", "._", "wrapper_", "._", "Function", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "opts_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fsc", "lient_", "=_", "self_", "._", "fsc", "lient_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "minion", "\\u", "opts_", "=_", "self_", "._", "minion", "\\u", "opts_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "self_", "._", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opts", "\\u", "pkg_", "=_", "pre", "\\u", "wrapper_", "[_", "'", "test", ".", "opts", "\\u", "pkg", "'_", "]_", "(_", ")_", "#", " ", "pylint", ":", " ", "disable", "=", "E1", "102_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opts", "\\u", "pkg_", "[_", "'", "file", "\\u", "root", "s", "'_", "]_", "=_", "self_", "._", "opts_", "[_", "'", "file", "\\u", "root", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opts", "\\u", "pkg_", "[_", "'", "pillar", "\\u", "root", "s", "'_", "]_", "=_", "self_", "._", "opts_", "[_", "'", "pillar", "\\u", "root", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opts", "\\u", "pkg_", "[_", "'", "ext", "\\u", "pillar", "'_", "]_", "=_", "self_", "._", "opts_", "[_", "'", "ext", "\\u", "pillar", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opts", "\\u", "pkg_", "[_", "'", "extensi", "on", "\\u", "module", "s", "'_", "]_", "=_", "self_", "._", "opts_", "[_", "'", "extensi", "on", "\\u", "module", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opts", "\\u", "pkg_", "[_", "'\\u", "ssh", "\\u", "version", "'_", "]_", "=_", "self_", "._", "opts_", "[_", "'\\u", "ssh", "\\u", "version", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opts", "\\u", "pkg_", "[_", "'\\u", "\\u", "master", "\\u", "opts", "\\u\\u'_", "]_", "=_", "self_", "._", "context_", "[_", "'", "master", "\\u", "opts", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'\\u", "caller", "\\u", "cachedir", "'_", "in_", "self_", "._", "opts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opts", "\\u", "pkg_", "[_", "'\\u", "caller", "\\u", "cachedir", "'_", "]_", "=_", "self_", "._", "opts_", "[_", "'\\u", "caller", "\\u", "cachedir", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opts", "\\u", "pkg_", "[_", "'\\u", "caller", "\\u", "cachedir", "'_", "]_", "=_", "self_", "._", "opts_", "[_", "'", "cachedir", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Us", "e", " ", "the", " ", "ID", " ", "defin", "ed", " ", "in", " ", "the", " ", "roster", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "opts", "\\u", "pkg_", "[_", "'", "id", "'_", "]_", "=_", "self_", "._", "id_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "retcode_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "'\\u", "error", "'_", "in_", "opts", "\\u", "pkg_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "Refr", "esh", " ", "failed_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "retcode_", "=_", "opts", "\\u", "pkg_", "[_", "'", "ret", "code", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ret_", "=_", "json_", "._", "dumps_", "(_", "{_", "'", "local", "'_", ":_", "opts", "\\u", "pkg_", "[_", "'\\u", "error", "'_", "]_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "ret_", ",_", "retcode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pillar", "_", "=_", "salt_", "._", "pillar", "_", "._", "Pil", "lar", "_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "opts", "\\u", "pkg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "opts", "\\u", "pkg_", "[_", "'", "grains", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "opts", "\\u", "pkg_", "[_", "'", "id", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "opts", "\\u", "pkg_", "._", "get_", "(_", "'", "environ", "ment", "'_", ",_", "'", "base", "'_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pillar", "\\u", "dirs_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pillar", "\\u", "data_", "=_", "pillar", "_", "._", "compile", "\\u", "pillar", "_", "(_", "pillar", "\\u", "dirs_", "=_", "pillar", "\\u", "dirs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "cache", " ", "minion", " ", "opts", " ", "in", " ", "datap", " ", "in", " ", "master", ".", "py_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "'", "opts", "'_", ":_", "opts", "\\u", "pkg_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "grains", "'_", ":_", "opts", "\\u", "pkg_", "[_", "'", "grains", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pillar", "'_", ":_", "pillar", "\\u", "data_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "data\\u", "cache_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "salt_", "._", "utils_", "._", "fop", "en_", "(_", "datap", "_", ",_", "'", "w", "+", "b", "'_", ")_", "as_", "fp", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "fp", "\\u_", "._", "write_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "serial_", "._", "dumps_", "(_", "data_", ")_", "\\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_", "if_", "not_", "data_", "and_", "data\\u", "cache_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "with_", "salt_", "._", "utils_", "._", "fop", "en_", "(_", "datap", "_", ",_", "'", "rb", "'_", ")_", "as_", "fp", "\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "=_", "self_", "._", "serial_", "._", "load_", "(_", "fp", "\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "opts_", "=_", "data_", "._", "get_", "(_", "'", "opts", "'_", ",_", "{_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "opts_", "[_", "'", "grains", "'_", "]_", "=_", "data_", "._", "get_", "(_", "'", "grains", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Restor", "e", " ", "master", " ", "grains", "_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "grain", "_", "in_", "conf", "\\u", "grains", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opts_", "[_", "'", "grains", "'_", "]_", "[_", "grain", "_", "]_", "=_", "conf", "\\u", "grains", "_", "[_", "grain", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Enable", " ", "roster", " ", "grains", " ", "support_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "grains", "'_", "in_", "self_", "._", "target_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "grain", "_", "in_", "self_", "._", "target_", "[_", "'", "grains", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opts_", "[_", "'", "grains", "'_", "]_", "[_", "grain", "_", "]_", "=_", "self_", "._", "target_", "[_", "'", "grains", "'_", "]_", "[_", "grain", "_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "opts_", "[_", "'", "pillar", "'_", "]_", "=_", "data_", "._", "get_", "(_", "'", "pillar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wrapper_", "=_", "salt_", "._", "client_", "._", "ssh_", "._", "wrapper_", "._", "Function", "Wrapper_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "opts_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fsc", "lient_", "=_", "self_", "._", "fsc", "lient_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "minion", "\\u", "opts_", "=_", "self_", "._", "minion", "\\u", "opts_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "self_", "._", "target_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "wf", "unc", "s_", "=_", "salt_", "._", "loader_", "._", "ssh", "\\u", "wrapper_", "(_", "opts_", ",_", "wrapper_", ",_", "self_", "._", "context_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "wrapper_", "._", "wf", "unc", "s_", "=_", "self_", "._", "wf", "unc", "s_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", "'", "re", " ", "runn", "ing", " ", "in", " ", "the", " ", "mind", ",", " ", "need", " ", "to", " ", "fetch", " ", "the", " ", "argu", "ment", "s", " ", "from", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "roster", ",", " ", "pillar", ",", " ", "master", " ", "config", " ", "(", "in", " ", "tha", "t", " ", "order", ")_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "mine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mine", "\\u", "args_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "mine", "\\u", "functions_", "and_", "self_", "._", "fun_", "in_", "self_", "._", "mine", "\\u", "functions_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mine", "\\u", "args_", "=_", "self_", "._", "mine", "\\u", "functions_", "[_", "self_", "._", "fun_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "opts_", "[_", "'", "pillar", "'_", "]_", "and_", "self_", "._", "fun_", "in_", "opts_", "[_", "'", "pillar", "'_", "]_", "._", "get_", "(_", "'", "mine", "\\u", "function", "s", "'_", ",_", "{_", "}_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mine", "\\u", "args_", "=_", "opts_", "[_", "'", "pillar", "'_", "]_", "[_", "'", "mine", "\\u", "function", "s", "'_", "]_", "[_", "self_", "._", "fun_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "self_", "._", "fun_", "in_", "self_", "._", "context_", "[_", "'", "master", "\\u", "opts", "'_", "]_", "._", "get_", "(_", "'", "mine", "\\u", "function", "s", "'_", ",_", "{_", "}_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mine", "\\u", "args_", "=_", "self_", "._", "context_", "[_", "'", "master", "\\u", "opts", "'_", "]_", "[_", "'", "mine", "\\u", "function", "s", "'_", "]_", "[_", "self_", "._", "fun_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "we", " ", "found", " ", "mine", "\\u", "args", ",", " ", "replace", " ", "our", " ", "command", "'", "s", " ", "args_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "mine", "\\u", "args_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "args_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "kwargs_", "=_", "mine", "\\u", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "mine", "\\u", "args_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "args_", "=_", "mine", "\\u", "args_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "kwargs_", "=_", "{_", "}_", "\\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 ", " _", "if_", "self_", "._", "mine_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "wrapper_", "[_", "self_", "._", "fun_", "]_", "(_", "*_", "self_", "._", "args_", ",_", "**_", "self_", "._", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "self_", "._", "wf", "unc", "s_", "[_", "self_", "._", "fun_", "]_", "(_", "*_", "self_", "._", "args_", ",_", "**_", "self_", "._", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "'", "Type", "Error", " ", "encounter", "ed", " ", "executi", "ng", " ", "{", "0", "}:", " ", "{", "1", "}'_", "._", "format_", "(_", "self_", "._", "fun_", ",_", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "error_", "(_", "result_", ",_", "exc", "\\u", "info", "\\u", "on", "\\u", "loglevel_", "=_", "logging_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retcode_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exception_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "'", "An", " ", "Except", "ion", " ", "occur", "red", " ", "whi", "le", " ", "executi", "ng", " ", "{", "0", "}:", " ", "{", "1", "}'_", "._", "format_", "(_", "self_", "._", "fun_", ",_", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "error_", "(_", "result_", ",_", "exc", "\\u", "info", "\\u", "on", "\\u", "loglevel_", "=_", "logging_", "._", "DEBUG_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "retcode_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Mim", "ic", " ", "the", " ", "json", " ", "data", "-", "structure", " ", "tha", "t", " ", "\"", "salt", "-", "call", " ", "--", "local", "\"", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "emit", " ", "(", "as", " ", "see", "n", " ", "in", " ", "ssh", "\\u", "py", "\\u", "shi", "m", ".", "py", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "result_", ",_", "dict_", ")_", "and_", "'", "local", "'_", "in_", "result_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ret_", "=_", "json_", "._", "dumps_", "(_", "{_", "'", "local", "'_", ":_", "result_", "[_", "'", "local", "'_", "]_", "}_", ")_", "\\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 ", " _", "ret_", "=_", "json_", "._", "dumps_", "(_", "{_", "'", "local", "'_", ":_", "{_", "'", "return", "'_", ":_", "result_", "}_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "ret_", ",_", "retcode_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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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 ]
Unnecessary pass
CybOXProject/python-cybox/cybox/bindings/code_object.py
[ { "content": " def exportChildren(self, lwrite, level, namespace_='CodeObj:', name_='CodeSegmentXORType', fromsubclass_=False, pretty_print=True):\n super(CodeSegmentXORType, self).exportChildren(lwrite, level, 'CodeObj:', name_, True, pretty_print=pretty_print)\n pass", "metadata": "root.CodeSegmentXORType.exportChildren", "header": "['class', 'CodeSegmentXORType', '(', 'cybox_common', '.', 'StringObjectPropertyType', ')', ':', '___EOS___']", "index": 63 }, { "content": " def exportChildren(self, lwrite, level, namespace_='CodeObj:', name_='ProcessorTypeType', fromsubclass_=False, pretty_print=True):\n super(ProcessorTypeType, self).exportChildren(lwrite, level, 'CodeObj:', name_, True, pretty_print=pretty_print)\n pass", "metadata": "root.ProcessorTypeType.exportChildren", "header": "['class', 'ProcessorTypeType', '(', 'cybox_common', '.', 'BaseObjectPropertyType', ')', ':', '___EOS___']", "index": 203 }, { "content": " def exportChildren(self, lwrite, level, namespace_='CodeObj:', name_='CodeLanguageType', fromsubclass_=False, pretty_print=True):\n super(CodeLanguageType, self).exportChildren(lwrite, level, 'CodeObj:', name_, True, pretty_print=pretty_print)\n pass", "metadata": "root.CodeLanguageType.exportChildren", "header": "['class', 'CodeLanguageType', '(', 'cybox_common', '.', 'BaseObjectPropertyType', ')', ':', '___EOS___']", "index": 276 }, { "content": " def exportChildren(self, lwrite, level, namespace_='CodeObj:', name_='CodePurposeType', fromsubclass_=False, pretty_print=True):\n super(CodePurposeType, self).exportChildren(lwrite, level, 'CodeObj:', name_, True, pretty_print=pretty_print)\n pass", "metadata": "root.CodePurposeType.exportChildren", "header": "['class', 'CodePurposeType', '(', 'cybox_common', '.', 'BaseObjectPropertyType', ')', ':', '___EOS___']", "index": 349 }, { "content": " def exportChildren(self, lwrite, level, namespace_='CodeObj:', name_='CodeTypeType', fromsubclass_=False, pretty_print=True):\n super(CodeTypeType, self).exportChildren(lwrite, level, 'CodeObj:', name_, True, pretty_print=pretty_print)\n pass", "metadata": "root.CodeTypeType.exportChildren", "header": "['class', 'CodeTypeType', '(', 'cybox_common', '.', 'BaseObjectPropertyType', ')', ':', '___EOS___']", "index": 422 } ]
[ { "span": "pass", "start_line": 65, "start_column": 8, "end_line": 65, "end_column": 12 }, { "span": "pass", "start_line": 205, "start_column": 8, "end_line": 205, "end_column": 12 }, { "span": "pass", "start_line": 278, "start_column": 8, "end_line": 278, "end_column": 12 }, { "span": "pass", "start_line": 351, "start_column": 8, "end_line": 351, "end_column": 12 }, { "span": "pass", "start_line": 424, "start_column": 8, "end_line": 424, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "class_", "Code", "Segme", "nt", "XO", "RT", "ype_", "(_", "cy", "box", "\\u", "common_", "._", "String", "Object", "Proper", "ty", "Type_", ")_", ":_", "\\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_", "export", "Children_", "(_", "self_", ",_", "lw", "rite_", ",_", "level_", ",_", "namespace\\u_", "=_", "'", "Code", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Code", "Segme", "nt", "XO", "RT", "ype", "'_", ",_", "froms", "ubc", "lass\\u", "_", "=_", "False_", ",_", "pretty", "\\u", "print_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Code", "Segme", "nt", "XO", "RT", "ype_", ",_", "self_", ")_", "._", "export", "Children_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Code", "Obj", ":'_", ",_", "name\\u_", ",_", "True_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Process", "or", "Type", "Type_", "(_", "cy", "box", "\\u", "common_", "._", "Base", "Object", "Proper", "ty", "Type_", ")_", ":_", "\\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_", "export", "Children_", "(_", "self_", ",_", "lw", "rite_", ",_", "level_", ",_", "namespace\\u_", "=_", "'", "Code", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Process", "or", "Type", "Type", "'_", ",_", "froms", "ubc", "lass\\u", "_", "=_", "False_", ",_", "pretty", "\\u", "print_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Process", "or", "Type", "Type_", ",_", "self_", ")_", "._", "export", "Children_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Code", "Obj", ":'_", ",_", "name\\u_", ",_", "True_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Code", "Lang", "ua", "ge", "Type_", "(_", "cy", "box", "\\u", "common_", "._", "Base", "Object", "Proper", "ty", "Type_", ")_", ":_", "\\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_", "export", "Children_", "(_", "self_", ",_", "lw", "rite_", ",_", "level_", ",_", "namespace\\u_", "=_", "'", "Code", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Code", "Lang", "ua", "ge", "Type", "'_", ",_", "froms", "ubc", "lass\\u", "_", "=_", "False_", ",_", "pretty", "\\u", "print_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Code", "Lang", "ua", "ge", "Type_", ",_", "self_", ")_", "._", "export", "Children_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Code", "Obj", ":'_", ",_", "name\\u_", ",_", "True_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Code", "Pur", "pose", "Type_", "(_", "cy", "box", "\\u", "common_", "._", "Base", "Object", "Proper", "ty", "Type_", ")_", ":_", "\\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_", "export", "Children_", "(_", "self_", ",_", "lw", "rite_", ",_", "level_", ",_", "namespace\\u_", "=_", "'", "Code", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Code", "Pur", "pose", "Type", "'_", ",_", "froms", "ubc", "lass\\u", "_", "=_", "False_", ",_", "pretty", "\\u", "print_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Code", "Pur", "pose", "Type_", ",_", "self_", ")_", "._", "export", "Children_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Code", "Obj", ":'_", ",_", "name\\u_", ",_", "True_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Code", "Type", "Type_", "(_", "cy", "box", "\\u", "common_", "._", "Base", "Object", "Proper", "ty", "Type_", ")_", ":_", "\\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_", "export", "Children_", "(_", "self_", ",_", "lw", "rite_", ",_", "level_", ",_", "namespace\\u_", "=_", "'", "Code", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Code", "Type", "Type", "'_", ",_", "froms", "ubc", "lass\\u", "_", "=_", "False_", ",_", "pretty", "\\u", "print_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Code", "Type", "Type_", ",_", "self_", ")_", "._", "export", "Children_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Code", "Obj", ":'_", ",_", "name\\u_", ",_", "True_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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, 0, 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, 0, 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, 0, 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, 0, 2 ]
Except block handles 'BaseException'
CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.5/pymel/internal/factories.py
[ { "content": "def addCmdDocsCallback(cmdName, docstring=''):\n loadCmdDocCache()\n\n cmdInfo = cmdlist[cmdName]\n\n #docstring = cmdInfo['description'] + '\\n\\n' + '\\n'.join(textwrap.wrap(docstring.strip(), DOC_WIDTH))\n\n docstring = '\\n'.join(textwrap.wrap(cmdInfo['description'], DOC_WIDTH)) + '\\n\\n' + docstring.strip()\n\n# if func.__doc__:\n# docstring += func.__doc__ + '\\n\\n'\n\n docstring = docstring.rstrip() + '\\n\\n'\n\n flagDocs = cmdInfo['flags']\n\n if flagDocs and sorted(flagDocs.keys()) != ['edit', 'query']:\n\n widths = [3, 100, 32, 32]\n altwidths = [ widths[0] + widths[1] ] + widths[2:]\n rowsep = ' +' + '+'.join( [ '-'*(w-1) for w in widths ] ) + '+\\n'\n headersep = ' +' + '+'.join( [ '='*(w-1) for w in widths ] ) + '+\\n'\n\n def makerow( items, widths ):\n return ' |' + '|'.join( ' ' + i.ljust(w-2) for i, w in zip( items, widths ) ) + '|\\n'\n\n\n docstring += 'Flags:\\n'\n\n if includeDocExamples:\n docstring += rowsep\n docstring += makerow( ['Long name (short name)', 'Argument Types', 'Properties'], altwidths )\n docstring += headersep\n\n for flag in sorted(flagDocs.keys()):\n if flag in ['edit', 'query']: continue\n docs = flagDocs[flag]\n\n # type\n try:\n typ = docs['args']\n except KeyError, e:\n raise KeyError(\"Error retrieving doc information for: %s, %s\\n%s\" % (cmdName, flag, e))\n if isinstance(typ, list):\n try:\n typ = [ x.__name__ for x in typ ]\n except:\n typ = [ str(x) for x in typ ]\n typ = ', '.join(typ)\n else:\n try:\n typ = typ.__name__\n except: pass\n\n # docstring\n descr = docs.get('docstring', '')\n\n # modes\n tmpmodes = docs.get('modes', [])\n modes = []\n if 'create' in tmpmodes: modes.append('create')\n if 'query' in tmpmodes: modes.append('query')\n if 'edit' in tmpmodes: modes.append('edit')\n\n if includeDocExamples:\n for data in util.izip_longest( ['**%s (%s)**' % (flag, docs['shortname'])],\n textwrap.wrap( '*%s*' % typ, widths[2]-2 ),\n [ '.. image:: /images/%s.gif' % m for m in modes],\n fillvalue='' ):\n docstring += makerow( data, altwidths )\n\n #docstring += makerow( ['**%s (%s)**' % (flag, docs['shortname']), '*%s*' % typ, ''], altwidths )\n #for m in modes:\n # docstring += makerow( ['', '', '.. image:: /images/%s.gif' % m], altwidths )\n\n docstring += rowsep\n\n descr_widths = [widths[0], sum(widths[1:])]\n if descr:\n for line in textwrap.wrap( descr.strip('|'), sum(widths[1:])-2 ):\n docstring += makerow( ['', line], descr_widths )\n # add some filler at the bottom\n docstring += makerow( ['', ' ..'], descr_widths )\n else:\n docstring += makerow( ['', ''], descr_widths )\n\n # empty row for spacing\n #docstring += rowsep\n #docstring += makerow( ['']*len(widths), widths )\n # closing separator\n docstring += rowsep\n\n else:\n descr = '\\n'.join([ ' '+x for x in textwrap.wrap(descr, DOC_WIDTH)])\n # add trailing newline\n descr = descr + '\\n' if descr else ''\n docstring += ' - %s %s [%s]\\n%s\\n' % (\n (flag + ' : ' + docs['shortname']).ljust(30),\n ('('+typ+')').ljust(15),\n ','.join( modes ),\n descr )\n# #modified\n# try:\n# modified = docs['modified']\n# if modified:\n# docstring += ' - modifies: *%s*\\n' % ( ', '.join( modified ))\n# except KeyError: pass\n#\n# #secondary flags\n# try:\n# docstring += ' - secondary flags: *%s*\\n' % ( ', '.join(docs['secondaryFlags'] ))\n# except KeyError: pass\n#\n #args\n\n\n docstring += '\\nDerived from mel command `maya.cmds.%s`\\n' % (cmdName)\n\n if includeDocExamples and cmdInfo.get('example',None):\n #docstring = \".. |create| image:: /images/create.gif\\n.. |edit| image:: /images/edit.gif\\n.. |query| image:: /images/query.gif\\n\\n\" + docstring\n docstring += '\\n\\nExample::\\n\\n' + cmdInfo['example']\n\n return docstring\n\n #func.__doc__ = docstring\n #return func", "metadata": "root.addCmdDocsCallback", "header": "['module', '___EOS___']", "index": 453 }, { "content": "def functionFactory( funcNameOrObject, returnFunc=None, module=None, rename=None, uiWidget=False ):\n \"\"\"\n create a new function, apply the given returnFunc to the results (if any),\n and add to the module given by 'moduleName'. Use pre-parsed command documentation\n to add to __doc__ strings for the command.\n \"\"\"\n\n #if module is None:\n # module = _thisModule\n\n inFunc = None\n if isinstance( funcNameOrObject, basestring ):\n funcName = funcNameOrObject\n\n # make sure that we import from pmcmds, not cmds\n if module and module!=cmds:\n try:\n inFunc = getattr(module, funcName)\n customFunc = True\n except AttributeError:\n #if funcName == 'lsThroughFilter': #_logger.debug(\"function %s not found in module %s\" % ( funcName, module.__name__))\n pass\n\n if not inFunc:\n try:\n inFunc = getattr(pmcmds,funcName)\n customFunc = False\n #if funcName == 'lsThroughFilter': #_logger.debug(\"function %s found in module %s: %s\" % ( funcName, cmds.__name__, inFunc.__name__))\n except AttributeError:\n #_logger.debug('Cannot find function %s' % funcNameOrObject)\n return\n else:\n funcName = pmcmds.getCmdName(funcNameOrObject)\n inFunc = funcNameOrObject\n customFunc = True\n\n # Do some sanity checks...\n if not callable(inFunc):\n _logger.warn('%s not callable' % funcNameOrObject)\n return\n\n cmdInfo = cmdlist[funcName]\n funcType = type(inFunc)\n # python doesn't like unicode function names\n funcName = str(funcName)\n\n if funcType == types.BuiltinFunctionType:\n try:\n newFuncName = inFunc.__name__\n if funcName != newFuncName:\n _logger.warn(\"Function found in module %s has different name than desired: %s != %s. simple fix? %s\" % ( inFunc.__module__, funcName, newFuncName, funcType == types.FunctionType and returnFunc is None))\n except AttributeError:\n _logger.warn(\"%s had no '__name__' attribute\" % inFunc)\n\n timeRangeFlags = _getTimeRangeFlags(funcName)\n\n\n # some refactoring done here - to avoid code duplication (and make things clearer),\n # we now ALWAYS do things in the following order:\n # 1. Perform operations which modify the execution of the function (ie, adding return funcs)\n # 2. Modify the function descriptors - ie, __doc__, __name__, etc\n\n\n # 1. Perform operations which modify the execution of the function (ie, adding return funcs)\n\n newFunc = inFunc\n\n if returnFunc or timeRangeFlags:\n # need to define a seperate var here to hold\n # the old value of newFunc, b/c 'return newFunc'\n # would be recursive\n beforeReturnFunc = newFunc\n def newFuncWithReturnFunc( *args, **kwargs):\n for flag in timeRangeFlags:\n try:\n # allow for open-ended time ranges:\n # (1,None), (1,), slice(1,None), \"1:\"\n # (None,100), slice(100), \":100\"\n # (None,None), \":\"\n val = kwargs[flag]\n except KeyError:\n pass\n else:\n if isinstance(val, slice):\n val = [val.start, val.stop]\n elif isinstance(val, basestring) and val.count(':') == 1:\n val = val.split(':')\n # keep this python 2.4 compatible\n\n for i, v in enumerate(val):\n if not v.strip():\n val[i] = None\n elif isinstance(val, int):\n val = (val,val)\n\n if isinstance(val, (tuple, list) ):\n val = list(val)\n if len(val)==2 :\n if val[0] is None:\n val[0] = cmds.findKeyframe(which='first')\n if val[1] is None:\n val[1] = cmds.findKeyframe(which='last')\n elif len(val)==1:\n val.append( cmds.findKeyframe(which='last') )\n kwargs[flag] = tuple(val)\n\n res = beforeReturnFunc(*args, **kwargs)\n if not kwargs.get('query', kwargs.get('q',False)): # and 'edit' not in kwargs and 'e' not in kwargs:\n if isinstance(res, list):\n # some node commands unnecessarily return a list with a single object\n if cmdInfo.get('resultNeedsUnpacking',False):\n res = returnFunc(res[0])\n else:\n try:\n res = map( returnFunc, res )\n except: pass\n\n elif res:\n try:\n res = returnFunc( res )\n except Exception, e:\n pass\n return res\n newFunc = newFuncWithReturnFunc\n\n if funcName in simpleCommandWraps:\n # simple wraps: we only do these for functions which have not been manually customized\n wraps = simpleCommandWraps[funcName]\n beforeSimpleWrap = newFunc\n def simpleWrapFunc(*args, **kwargs):\n res = beforeSimpleWrap(*args, **kwargs)\n for func, wrapCondition in wraps:\n if wrapCondition.eval(kwargs):\n res = func(res)\n break\n return res\n newFunc = simpleWrapFunc\n doc = 'Modifications:\\n'\n for func, wrapCondition in wraps:\n if wrapCondition != Always:\n # use only the long flag name\n flags = ' for flags: ' + str(wrapCondition)\n elif len(wraps)>1:\n flags = ' for all other flags'\n else:\n flags = ''\n if func.__doc__:\n funcString = func.__doc__.strip()\n else:\n funcString = pmcmds.getCmdName(func) + '(result)'\n doc += ' - ' + funcString + flags + '\\n'\n\n newFunc.__doc__ = doc\n\n #----------------------------\n # UI commands with callbacks\n #----------------------------\n\n callbackFlags = cmdInfo.get('callbackFlags', None)\n if callbackFlags:\n newFunc = fixCallbacks( newFunc, callbackFlags, funcName )\n\n # Check if we have not been wrapped yet. if we haven't and our input function is a builtin or we're renaming\n # then we need a wrap. otherwise we can just change the __doc__ and __name__ and move on\n if newFunc == inFunc and (type(newFunc) == types.BuiltinFunctionType or rename):\n # we'll need a new function: we don't want to touch built-ins, or\n # rename an existing function, as that can screw things up... just modifying docs\n # of non-builtin should be fine, though\n def newFunc(*args, **kwargs):\n return inFunc(*args, **kwargs)\n\n # 2. Modify the function descriptors - ie, __doc__, __name__, etc\n if customFunc:\n # copy over the exisitng docs\n if not newFunc.__doc__:\n newFunc.__doc__ = inFunc.__doc__\n elif inFunc.__doc__:\n newFunc.__doc__ = inFunc.__doc__\n _addCmdDocs(newFunc, funcName)\n\n if rename:\n newFunc.__name__ = rename\n else:\n newFunc.__name__ = funcName\n\n return newFunc", "metadata": "root.functionFactory", "header": "['module', '___EOS___']", "index": 812 }, { "content": " def getGetterInfo(self):\n try:\n inverse, isgetter = self.methodInfo['inverse']\n if isgetter:\n if hasattr( getattr(api, self.apiClassName), inverse ):\n return ApiArgUtil( self.apiClassName, inverse, self.methodIndex )\n except:\n pass", "metadata": "root.ApiArgUtil.getGetterInfo", "header": "['class', 'ApiArgUtil', '(', 'object', ')', ':', '___EOS___']", "index": 1430 }, { "content": " def _createNode( self ):\n \"\"\"\n Create the undo node.\n\n Any type of node will do. I've chosen a 'facade' node since it\n doesn't have too much overhead and won't get deleted if the user\n optimizes the scene.\n\n Note that we don't want to use Maya commands here because they\n would pollute Maya's undo queue, so we use API calls instead.\n \"\"\"\n\n ns = api.MNamespace.currentNamespace()\n api.MNamespace.setCurrentNamespace(':')\n self.flushUndo()\n\n dgmod = api.MDGModifier()\n self.undoNode = dgmod.createNode('facade')\n dgmod.renameNode(self.undoNode, self.node_name)\n dgmod.doIt()\n\n api.MNamespace.setCurrentNamespace(ns)\n\n # Add an attribute to keep a count of the commands in the stack.\n attrFn = api.MFnNumericAttribute()\n self.cmdCountAttr = attrFn.create( 'cmdCount', 'cc',\n api.MFnNumericData.kInt\n )\n\n nodeFn = api.MFnDependencyNode(self.undoNode)\n self.node_name = nodeFn.name()\n nodeFn.addAttribute(self.cmdCountAttr)\n\n nodeFn.setDoNotWrite(True)\n nodeFn.setLocked(True)\n\n try:\n api.MMessage.removeCallback( self.cbid )\n if hasattr(self.cbid, 'disown'):\n self.cbid.disown()\n except:\n pass\n self.cbid = api.MNodeMessage.addAttributeChangedCallback( self.undoNode, self._attrChanged )", "metadata": "root.ApiUndo._createNode", "header": "['class', 'ApiUndo', ':', '___EOS___']", "index": 1827 }, { "content": " def append(self, cmdObj ):\n\n self.cb_enabled = False\n\n# if not cmds.objExists( self.node_name ):\n# self._createNode()\n\n # Increment the undo node's command count. We want this to go into\n # Maya's undo queue because changes to this attr will trigger our own\n # undo/redo code.\n try:\n count = cmds.getAttr(self.node_name + '.cmdCount')\n except:\n self._createNode()\n count = cmds.getAttr(self.node_name + '.cmdCount')\n\n cmds.setAttr(self.node_name + '.cmdCount', count + 1)\n\n # Append the command to the end of the undo queue.\n self.undo_queue.append(cmdObj)\n\n # Clear the redo queue.\n self.redo_queue = []\n\n # Re-enable the callback.\n self.cb_enabled = True", "metadata": "root.ApiUndo.append", "header": "['class', 'ApiUndo', ':', '___EOS___']", "index": 1872 } ]
[ { "span": "except:", "start_line": 499, "start_column": 16, "end_line": 499, "end_column": 23 }, { "span": "except: ", "start_line": 505, "start_column": 16, "end_line": 505, "end_column": 23 }, { "span": "except: ", "start_line": 927, "start_column": 24, "end_line": 927, "end_column": 31 }, { "span": "except:", "start_line": 1436, "start_column": 8, "end_line": 1436, "end_column": 15 }, { "span": "except:", "start_line": 1867, "start_column": 8, "end_line": 1867, "end_column": 15 }, { "span": "except:", "start_line": 1884, "start_column": 8, "end_line": 1884, "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Cmd", "Docs", "Callback_", "(_", "cmd", "Name_", ",_", "docstring_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "load", "Cmd", "Doc", "Cache_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cmd", "Info_", "=_", "cmdli", "st_", "[_", "cmd", "Name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "docstr", "ing", " ", "=", " ", "cmd", "Info", "['", "description", "']", " ", "+", " ", "'\\\\", "n", "\\\\", "n", "'", " ", "+", " ", "'\\\\", "n", "'.", "join", "(", "text", "wrap", ".", "wrap", "(", "docstr", "ing", ".", "strip", "()", ",", " ", "DOC", "\\u", "WID", "TH", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "docstring_", "=_", "'\\\\", "n", "'_", "._", "join_", "(_", "textwrap_", "._", "wrap_", "(_", "cmd", "Info_", "[_", "'", "description", "'_", "]_", ",_", "DOC", "\\u", "WIDTH_", ")_", ")_", "+_", "'\\\\", "n", "\\\\", "n", "'_", "+_", "docstring_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "func", ".\\u", "\\u", "doc", "\\u\\u:", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "docstr", "ing", " ", "+=", " ", "func", ".\\u", "\\u", "doc", "\\u\\u", " ", "+", " ", "'\\\\", "n", "\\\\", "n", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "docstring_", "=_", "docstring_", "._", "rstrip_", "(_", ")_", "+_", "'\\\\", "n", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "flag", "Docs", "_", "=_", "cmd", "Info_", "[_", "'", "flags", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "flag", "Docs", "_", "and_", "sorted_", "(_", "flag", "Docs", "_", "._", "keys_", "(_", ")_", ")_", "!=_", "[_", "'", "edit", "'_", ",_", "'", "query", "'_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "widths_", "=_", "[_", "3_", ",_", "100_", ",_", "32_", ",_", "32_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "alt", "widths_", "=_", "[_", "widths_", "[_", "0_", "]_", "+_", "widths_", "[_", "1_", "]_", "]_", "+_", "widths_", "[_", "2_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rowse", "p_", "=_", "'", " ", " ", " ", " ", "+'_", "+_", "'+'_", "._", "join_", "(_", "[_", "'-'_", "*_", "(_", "w_", "-_", "1_", ")_", "for_", "w_", "in_", "widths_", "]_", ")_", "+_", "'+", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "header", "sep_", "=_", "'", " ", " ", " ", " ", "+'_", "+_", "'+'_", "._", "join_", "(_", "[_", "'='_", "*_", "(_", "w_", "-_", "1_", ")_", "for_", "w_", "in_", "widths_", "]_", ")_", "+_", "'+", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "maker", "ow_", "(_", "items_", ",_", "widths_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'", " ", " ", " ", " ", "|'_", "+_", "'|'_", "._", "join_", "(_", "'", " ", "'_", "+_", "i_", "._", "ljust_", "(_", "w_", "-_", "2_", ")_", "for_", "i_", ",_", "w_", "in_", "zip_", "(_", "items_", ",_", "widths_", ")_", ")_", "+_", "'|", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "docstring_", "+=_", "'", "Fla", "gs", ":\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "include", "Doc", "Exam", "ples", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "docstring_", "+=_", "rowse", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "docstring_", "+=_", "maker", "ow_", "(_", "[_", "'", "Long", " ", "name", " ", "(", "short", " ", "name", ")'_", ",_", "'", "Arg", "ument", " ", "Type", "s", "'_", ",_", "'", "Proper", "ties", "'_", "]_", ",_", "alt", "widths_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "docstring_", "+=_", "header", "sep_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "flag_", "in_", "sorted_", "(_", "flag", "Docs", "_", "._", "keys_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "flag_", "in_", "[_", "'", "edit", "'_", ",_", "'", "query", "'_", "]_", ":_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "docs_", "=_", "flag", "Docs", "_", "[_", "flag_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "type_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "typ_", "=_", "docs_", "[_", "'", "args", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Key", "Error_", "(_", "\"", "Error", " ", "retrie", "ving", " ", "doc", " ", "informati", "on", " ", "for", ":", " ", "%", "s", ",", " ", "%", "s", "\\\\", "n", "%", "s", "\"_", "%_", "(_", "cmd", "Name_", ",_", "flag_", ",_", "e_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "typ_", ",_", "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 ", " ", "_", "typ_", "=_", "[_", "x_", "._", "\\u\\u", "name\\u\\u_", "for_", "x_", "in_", "typ_", "]_", "\\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 ", " ", "_", "typ_", "=_", "[_", "str_", "(_", "x_", ")_", "for_", "x_", "in_", "typ_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "typ_", "=_", "',", " ", "'_", "._", "join_", "(_", "typ_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "typ_", "=_", "typ_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "docstring_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "descr_", "=_", "docs_", "._", "get_", "(_", "'", "docstr", "ing", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modes_", "\\u\\u\\uNL\\u\\u\\u_", "tmp", "modes_", "=_", "docs_", "._", "get_", "(_", "'", "mode", "s", "'_", ",_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "modes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "create", "'_", "in_", "tmp", "modes_", ":_", "modes_", "._", "append_", "(_", "'", "create", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "query", "'_", "in_", "tmp", "modes_", ":_", "modes_", "._", "append_", "(_", "'", "query", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "edit", "'_", "in_", "tmp", "modes_", ":_", "modes_", "._", "append_", "(_", "'", "edit", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "include", "Doc", "Exam", "ples", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "data_", "in_", "util_", "._", "izi", "p", "\\u", "longest_", "(_", "[_", "'**", "%", "s", " ", "(%", "s", ")**", "'_", "%_", "(_", "flag_", ",_", "docs_", "[_", "'", "short", "name", "'_", "]_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "textwrap_", "._", "wrap_", "(_", "'*", "%", "s", "*'_", "%_", "typ_", ",_", "widths_", "[_", "2_", "]_", "-_", "2_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "'..", " ", "image", "::", " ", "/", "images", "/", "%", "s", ".", "gif", "'_", "%_", "m_", "for_", "m_", "in_", "modes_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fill", "value_", "=_", "''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "docstring_", "+=_", "maker", "ow_", "(_", "data_", ",_", "alt", "widths_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "docstr", "ing", " ", "+=", " ", "maker", "ow", "(", " ", "['", "**", "%", "s", " ", "(%", "s", ")**", "'", " ", "%", " ", "(", "flag", ",", " ", "docs", "['", "short", "name", "'])", ",", " ", "'*", "%", "s", "*'", " ", "%", " ", "typ", ",", " ", "''", "],", " ", "alt", "widths", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "for", " ", "m", " ", "in", " ", "mode", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "docstr", "ing", " ", "+=", " ", "maker", "ow", "(", " ", "['", "',", " ", "''", ",", " ", "'..", " ", "image", "::", " ", "/", "images", "/", "%", "s", ".", "gif", "'", " ", "%", " ", "m", "],", " ", "alt", "widths", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "docstring_", "+=_", "rowse", "p_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "descr", "\\u", "widths_", "=_", "[_", "widths_", "[_", "0_", "]_", ",_", "sum_", "(_", "widths_", "[_", "1_", ":_", "]_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "descr_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "for_", "line_", "in_", "textwrap_", "._", "wrap_", "(_", "descr_", "._", "strip_", "(_", "'|'_", ")_", ",_", "sum_", "(_", "widths_", "[_", "1_", ":_", "]_", ")_", "-_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "docstring_", "+=_", "maker", "ow_", "(_", "[_", "''_", ",_", "line_", "]_", ",_", "descr", "\\u", "widths_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "some", " ", "filler", " ", "at", " ", "the", " ", "bottom_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "docstring_", "+=_", "maker", "ow_", "(_", "[_", "''_", ",_", "'", " ", " ", "..'_", "]_", ",_", "descr", "\\u", "widths_", ")_", "\\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 ", " ", "_", "docstring_", "+=_", "maker", "ow_", "(_", "[_", "''_", ",_", "''_", "]_", ",_", "descr", "\\u", "widths_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "empty", " ", "row", " ", "for", " ", "spacing_", "\\u\\u\\uNL\\u\\u\\u_", "#", "docstr", "ing", " ", "+=", " ", "rowse", "p_", "\\u\\u\\uNL\\u\\u\\u_", "#", "docstr", "ing", " ", "+=", " ", "maker", "ow", "(", " ", "['", "']", "*", "len", "(", "widths", "),", " ", "widths", " ", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "clos", "ing", " ", "separator_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "docstring_", "+=_", "rowse", "p_", "\\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 ", " _", "descr_", "=_", "'\\\\", "n", "'_", "._", "join_", "(_", "[_", "'", " ", " ", "'_", "+_", "x_", "for_", "x_", "in_", "textwrap_", "._", "wrap_", "(_", "descr_", ",_", "DOC", "\\u", "WIDTH_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "add", " ", "trail", "ing", " ", "newline_", "\\u\\u\\uNL\\u\\u\\u_", "descr_", "=_", "descr_", "+_", "'\\\\", "n", "'_", "if_", "descr_", "else_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "docstring_", "+=_", "'", " ", " ", "-", " ", "%", "s", " ", "%", "s", " ", "[", "%", "s", "]\\\\", "n", "%", "s", "\\\\", "n", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "flag_", "+_", "'", " ", ":", " ", "'_", "+_", "docs_", "[_", "'", "short", "name", "'_", "]_", ")_", "._", "ljust_", "(_", "30_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'('_", "+_", "typ_", "+_", "')'_", ")_", "._", "ljust_", "(_", "15_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "','_", "._", "join_", "(_", "modes_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "descr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "#", "modified_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "modifi", "ed", " ", "=", " ", "docs", "['", "modifi", "ed", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "modifi", "ed", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "docstr", "ing", " ", "+=", " ", "'", " ", " ", " ", " ", "-", " ", "modifi", "es", ":", " ", "*", "%", "s", "*\\\\", "n", "'", " ", "%", " ", "(", " ", "',", " ", "'.", "join", "(", " ", "modifi", "ed", " ", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "except", " ", "Key", "Error", ":", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "#", "second", "ary", " ", "flags_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "try", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "docstr", "ing", " ", "+=", " ", "'", " ", " ", " ", " ", "-", " ", "second", "ary", " ", "flags", ":", " ", "*", "%", "s", "*\\\\", "n", "'", " ", "%", " ", "(", " ", "',", " ", "'.", "join", "(", "docs", "['", "second", "ary", "Fla", "gs", "']", " ", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "except", " ", "Key", "Error", ":", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "args_", "\\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_", "docstring_", "+=_", "'\\\\", "n", "Derive", "d", " ", "from", " ", "mel", " ", "command", " ", "`", "maya", ".", "cmds", ".", "%", "s", "`", "\\\\", "n", "'_", "%_", "(_", "cmd", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "include", "Doc", "Exam", "ples", "_", "and_", "cmd", "Info_", "._", "get_", "(_", "'", "example", "'_", ",_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "docstr", "ing", " ", "=", " ", "\"..", " ", "|", "create", "|", " ", "image", "::", " ", "/", "images", "/", "create", ".", "gif", "\\\\", "n", "..", " ", "|", "edit", "|", " ", "image", "::", " ", "/", "images", "/", "edit", ".", "gif", "\\\\", "n", "..", " ", "|", "query", "|", " ", "image", "::", " ", "/", "images", "/", "query", ".", "gif", "\\\\", "n", "\\\\", "n", "\"", " ", "+", " ", "docstring_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "docstring_", "+=_", "'\\\\", "n", "\\\\", "n", "Exam", "ple", "::", "\\\\", "n", "\\\\", "n", "'_", "+_", "cmd", "Info_", "[_", "'", "example", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "docstring_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "func", ".\\u", "\\u", "doc", "\\u\\u", " ", "=", " ", "docstring_", "\\u\\u\\uNL\\u\\u\\u_", "#", "return", " ", "func_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "function", "Factory_", "(_", "func", "Name", "Or", "Object_", ",_", "return", "Func_", "=_", "None_", ",_", "module_", "=_", "None_", ",_", "rename_", "=_", "None_", ",_", "ui", "Widget_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "create", " ", "a", " ", "new", " ", "function", ",", " ", "appl", "y", " ", "the", " ", "give", "n", " ", "return", "Func", " ", "to", " ", "the", " ", "results", " ", "(", "if", " ", "any", "),", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "add", " ", "to", " ", "the", " ", "module", " ", "give", "n", " ", "by", " ", "'", "module", "Name", "'.", " ", " ", "Us", "e", " ", "pre", "-", "parsed", " ", "command", " ", "documentation", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "add", " ", "to", " ", "\\u\\u", "doc", "\\u\\u", " ", "string", "s", " ", "for", " ", "the", " ", "command", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "module", " ", "is", " ", "Non", "e", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "module", " ", "=", " ", "\\u", "this", "Module_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "in", "Func_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "func", "Name", "Or", "Object_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "func", "Name_", "=_", "func", "Name", "Or", "Object_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "tha", "t", " ", "we", " ", "import", " ", "from", " ", "pmc", "mds", ",", " ", "not", " ", "cmds_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "module_", "and_", "module_", "!=_", "cmds_", ":_", "\\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 ", " _", "in", "Func_", "=_", "getattr_", "(_", "module_", ",_", "func", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "custom", "Func_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "func", "Name", " ", "==", " ", "'", "ls", "Through", "Filter", "':", " ", "#\\u", "logg", "er", ".", "debug", "(\"", "function", " ", "%", "s", " ", "not", " ", "found", " ", "in", " ", "module", " ", "%", "s", "\"", " ", "%", " ", "(", " ", "func", "Name", ",", " ", "module", ".\\u", "\\u", "name", "\\u\\u)", ")_", "\\u\\u\\uNL\\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_", "if_", "not_", "in", "Func_", ":_", "\\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 ", " _", "in", "Func_", "=_", "getattr_", "(_", "pmc", "mds", "_", ",_", "func", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "custom", "Func_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "if", " ", "func", "Name", " ", "==", " ", "'", "ls", "Through", "Filter", "':", " ", "#\\u", "logg", "er", ".", "debug", "(\"", "function", " ", "%", "s", " ", "found", " ", "in", " ", "module", " ", "%", "s", ":", " ", "%", "s", "\"", " ", "%", " ", "(", " ", "func", "Name", ",", " ", "cmds", ".\\u", "\\u", "name", "\\u\\u", ",", " ", "in", "Func", ".\\u", "\\u", "name", "\\u\\u)", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#\\u", "logg", "er", ".", "debug", "('", "Cann", "ot", " ", "find", " ", "function", " ", "%", "s", "'", " ", "%", " ", "func", "Name", "Or", "Object", ")_", "\\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_", "\\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", "Name_", "=_", "pmc", "mds", "_", "._", "get", "Cmd", "Name_", "(_", "func", "Name", "Or", "Object_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "in", "Func_", "=_", "func", "Name", "Or", "Object_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "custom", "Func_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Do", " ", "some", " ", "sanity", " ", "checks", "..._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "callable_", "(_", "in", "Func_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "warn_", "(_", "'%", "s", " ", "not", " ", "calla", "ble", "'_", "%_", "func", "Name", "Or", "Object_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmd", "Info_", "=_", "cmdli", "st_", "[_", "func", "Name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "func", "Type_", "=_", "type_", "(_", "in", "Func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "python", " ", "doe", "sn", "'", "t", " ", "like", " ", "unicode", " ", "function", " ", "names_", "\\u\\u\\uNL\\u\\u\\u_", "func", "Name_", "=_", "str_", "(_", "func", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "func", "Type_", "==_", "types_", "._", "Bu", "ilt", "in", "Function", "Type_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "Func", "Name_", "=_", "in", "Func_", "._", "\\u\\u", "name\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "func", "Name_", "!=_", "new", "Func", "Name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "warn_", "(_", "\"", "Function", " ", "found", " ", "in", " ", "module", " ", "%", "s", " ", "has", " ", "different", " ", "name", " ", "than", " ", "desi", "red", ":", " ", "%", "s", " ", "!=", " ", "%", "s", ".", " ", "simple", " ", "fix", "?", " ", "%", "s", "\"_", "%_", "(_", "in", "Func_", "._", "\\u\\u", "module\\u\\u_", ",_", "func", "Name_", ",_", "new", "Func", "Name_", ",_", "func", "Type_", "==_", "types_", "._", "Function", "Type_", "and_", "return", "Func_", "is_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Attribute", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "logger_", "._", "warn_", "(_", "\"%", "s", " ", "had", " ", "no", " ", "'\\u", "\\u", "name", "\\u\\u'", " ", "attribute", "\"_", "%_", "in", "Func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time", "Range", "Flags_", "=_", "\\u", "get", "Time", "Range", "Flags_", "(_", "func", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "some", " ", "refactor", "ing", " ", "don", "e", " ", "here", " ", "-", " ", "to", " ", "avoid", " ", "code", " ", "duplicat", "ion", " ", "(", "and", " ", "make", " ", "thing", "s", " ", "clear", "er", "),", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "we", " ", "now", " ", "ALWAYS", " ", "do", " ", "thing", "s", " ", "in", " ", "the", " ", "follow", "ing", " ", "order", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", ".", " ", "Perform", " ", "operati", "ons", " ", "whi", "ch", " ", "modif", "y", " ", "the", " ", "executi", "on", " ", "of", " ", "the", " ", "function", " ", "(", "ie", ",", " ", "addin", "g", " ", "return", " ", "funcs", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", ".", " ", "Modif", "y", " ", "the", " ", "function", " ", "descrip", "tors", " ", "-", " ", "ie", ",", " ", "\\u\\u", "doc", "\\u\\u", ",", " ", "\\u\\u", "name", "\\u\\u", ",", " ", "etc", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", ".", " ", "Perform", " ", "operati", "ons", " ", "whi", "ch", " ", "modif", "y", " ", "the", " ", "executi", "on", " ", "of", " ", "the", " ", "function", " ", "(", "ie", ",", " ", "addin", "g", " ", "return", " ", "funcs", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "Func_", "=_", "in", "Func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "return", "Func_", "or_", "time", "Range", "Flags_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "need", " ", "to", " ", "defin", "e", " ", "a", " ", "seperat", "e", " ", "var", " ", "here", " ", "to", " ", "hold_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "old", " ", "value", " ", "of", " ", "new", "Func", ",", " ", "b", "/", "c", " ", "'", "return", " ", "new", "Func", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "wou", "ld", " ", "be", " ", "recursive_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "bef", "ore", "Return", "Func_", "=_", "new", "Func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "new", "Func", "With", "Return", "Func_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "flag_", "in_", "time", "Range", "Flags_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "allow", " ", "for", " ", "open", "-", "ende", "d", " ", "time", " ", "ranges", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "1", ",", "Non", "e", "),", " ", "(", "1", ",)", ",", " ", "slice", "(", "1", ",", "Non", "e", "),", " ", "\"", "1", ":\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "Non", "e", ",", "100", "),", " ", "slice", "(", "100", "),", " ", "\":", "100", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "Non", "e", ",", "Non", "e", "),", " ", "\":\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "val_", "=_", "kwargs_", "[_", "flag_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "isinstance_", "(_", "val_", ",_", "slice_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "val_", "=_", "[_", "val_", "._", "start_", ",_", "val_", "._", "stop_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "isinstance_", "(_", "val_", ",_", "basestring_", ")_", "and_", "val_", "._", "count_", "(_", "':'_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "val_", "=_", "val_", "._", "split_", "(_", "':'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "keep", " ", "this", " ", "python", " ", "2.4", " ", "compatible_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", ",_", "v_", "in_", "enumerate_", "(_", "val_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "not_", "v_", "._", "strip_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "val_", "[_", "i_", "]_", "=_", "None_", "\\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_", "isinstance_", "(_", "val_", ",_", "int_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "val_", "=_", "(_", "val_", ",_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "val_", ",_", "(_", "tuple_", ",_", "list_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "val_", "=_", "list_", "(_", "val_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "val_", ")_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "if_", "val_", "[_", "0_", "]_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "val_", "[_", "0_", "]_", "=_", "cmds_", "._", "find", "Key", "frame_", "(_", "which_", "=_", "'", "first", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "val_", "[_", "1_", "]_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "val_", "[_", "1_", "]_", "=_", "cmds_", "._", "find", "Key", "frame_", "(_", "which_", "=_", "'", "last", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "val_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "val_", "._", "append_", "(_", "cmds_", "._", "find", "Key", "frame_", "(_", "which_", "=_", "'", "last", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwargs_", "[_", "flag_", "]_", "=_", "tuple_", "(_", "val_", ")_", "\\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_", "res_", "=_", "bef", "ore", "Return", "Func_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "kwargs_", "._", "get_", "(_", "'", "query", "'_", ",_", "kwargs_", "._", "get_", "(_", "'", "q", "'_", ",_", "False_", ")_", ")_", ":_", "#", " ", "and", " ", "'", "edit", "'", " ", "not", " ", "in", " ", "kwarg", "s", " ", "and", " ", "'", "e", "'", " ", "not", " ", "in", " ", "kwarg", "s", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "res_", ",_", "list_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "some", " ", "node", " ", "command", "s", " ", "unne", "cess", "ari", "ly", " ", "return", " ", "a", " ", "list", " ", "with", " ", "a", " ", "single", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "cmd", "Info_", "._", "get_", "(_", "'", "result", "Ne", "eds", "Unpack", "ing", "'_", ",_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "res_", "=_", "return", "Func_", "(_", "res_", "[_", "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 ", " ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "res_", "=_", "map_", "(_", "return", "Func_", ",_", "res_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "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_", "res_", ":_", "\\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 ", " ", " _", "res_", "=_", "return", "Func_", "(_", "res_", ")_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "Func_", "=_", "new", "Func", "With", "Return", "Func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "func", "Name_", "in_", "simple", "Command", "Wra", "ps_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "simple", " ", "wrap", "s", ":", " ", "we", " ", "only", " ", "do", " ", "these", " ", "for", " ", "function", "s", " ", "whi", "ch", " ", "have", " ", "not", " ", "bee", "n", " ", "manu", "ally", " ", "customize", "d_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "wraps_", "=_", "simple", "Command", "Wra", "ps_", "[_", "func", "Name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bef", "ore", "Simple", "Wrap_", "=_", "new", "Func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "simple", "Wra", "p", "Func_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "bef", "ore", "Simple", "Wrap_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "func_", ",_", "wrap", "Condition_", "in_", "wraps_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "wrap", "Condition_", "._", "eval_", "(_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "res_", "=_", "func_", "(_", "res_", ")_", "\\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_", "return_", "res_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "Func_", "=_", "simple", "Wra", "p", "Func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "=_", "'", "Modifica", "tion", "s", ":\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "func_", ",_", "wrap", "Condition_", "in_", "wraps_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "wrap", "Condition_", "!=_", "Al", "ways_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "use", " ", "only", " ", "the", " ", "long", " ", "flag", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flags_", "=_", "'", " ", "for", " ", "flags", ":", " ", "'_", "+_", "str_", "(_", "wrap", "Condition_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "wraps_", ")_", ">_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "flags_", "=_", "'", " ", "for", " ", "all", " ", "other", " ", "flags", "'_", "\\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 ", " _", "flags_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "func_", "._", "\\u\\u", "doc\\u\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "func", "String_", "=_", "func_", "._", "\\u\\u", "doc\\u\\u_", "._", "strip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "func", "String_", "=_", "pmc", "mds", "_", "._", "get", "Cmd", "Name_", "(_", "func_", ")_", "+_", "'(", "result", ")'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "doc_", "+=_", "'", " ", " ", "-", " ", "'_", "+_", "func", "String_", "+_", "flags_", "+_", "'\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "Func_", "._", "\\u\\u", "doc\\u\\u_", "=_", "doc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "-------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "UI", " ", "command", "s", " ", "with", " ", "callbacks_", "\\u\\u\\uNL\\u\\u\\u_", "#-", "--------------", "-------------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "callback", "Flags_", "=_", "cmd", "Info_", "._", "get_", "(_", "'", "callback", "Fla", "gs", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "callback", "Flags_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "Func_", "=_", "fix", "Callbacks_", "(_", "new", "Func_", ",_", "callback", "Flags_", ",_", "func", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "if", " ", "we", " ", "have", " ", "not", " ", "bee", "n", " ", "wrapp", "ed", " ", "ye", "t", ".", " ", "if", " ", "we", " ", "have", "n", "'", "t", " ", "and", " ", "our", " ", "input", " ", "function", " ", "is", " ", "a", " ", "bui", "lti", "n", " ", "or", " ", "we", "'", "re", " ", "rena", "ming", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "then", " ", "we", " ", "need", " ", "a", " ", "wrap", ".", " ", "other", "wis", "e", " ", "we", " ", "can", " ", "just", " ", "change", " ", "the", " ", "\\u\\u", "doc", "\\u\\u", " ", "and", " ", "\\u\\u", "name", "\\u\\u", " ", "and", " ", "move", " ", "on_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "new", "Func_", "==_", "in", "Func_", "and_", "(_", "type_", "(_", "new", "Func_", ")_", "==_", "types_", "._", "Bu", "ilt", "in", "Function", "Type_", "or_", "rename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", "'", "ll", " ", "need", " ", "a", " ", "new", " ", "function", ":", " ", "we", " ", "don", "'", "t", " ", "want", " ", "to", " ", "touch", " ", "bui", "lt", "-", "ins", ",", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "rename", " ", "an", " ", "exist", "ing", " ", "function", ",", " ", "as", " ", "tha", "t", " ", "can", " ", "scre", "w", " ", "thing", "s", " ", "up", "...", " ", "just", " ", "modif", "ying", " ", "docs_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "non", "-", "bui", "lti", "n", " ", "shou", "ld", " ", "be", " ", "fine", ",", " ", "tho", "ugh", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "new", "Func_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "in", "Func_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", ".", " ", "Modif", "y", " ", "the", " ", "function", " ", "descrip", "tors", " ", "-", " ", "ie", ",", " ", "\\u\\u", "doc", "\\u\\u", ",", " ", "\\u\\u", "name", "\\u\\u", ",", " ", "etc", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "custom", "Func_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "copy", " ", "over", " ", "the", " ", "exi", "sit", "ng", " ", "docs_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "new", "Func_", "._", "\\u\\u", "doc\\u\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "Func_", "._", "\\u\\u", "doc\\u\\u_", "=_", "in", "Func_", "._", "\\u\\u", "doc\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "in", "Func_", "._", "\\u\\u", "doc\\u\\u_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "Func_", "._", "\\u\\u", "doc\\u\\u_", "=_", "in", "Func_", "._", "\\u\\u", "doc\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "add", "Cmd", "Docs", "_", "(_", "new", "Func_", ",_", "func", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "rename_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "new", "Func_", "._", "\\u\\u", "name\\u\\u_", "=_", "rename_", "\\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 ", " _", "new", "Func_", "._", "\\u\\u", "name\\u\\u_", "=_", "func", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "new", "Func_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ap", "i", "Arg", "Util_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "Getter", "Info_", "(_", "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 ", " _", "inverse_", ",_", "is", "getter_", "=_", "self_", "._", "method", "Info_", "[_", "'", "inv", "erse", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "is", "getter_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "getattr_", "(_", "api_", ",_", "self_", "._", "api", "Class", "Name_", ")_", ",_", "inverse_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "return_", "Ap", "i", "Arg", "Util_", "(_", "self_", "._", "api", "Class", "Name_", ",_", "inverse_", ",_", "self_", "._", "method", "Index_", ")_", "\\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_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ap", "i", "Und", "o_", ":_", "\\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", "create", "Node_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "the", " ", "undo", " ", "node", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Any", " ", "type", " ", "of", " ", "node", " ", "will", " ", "do", ".", " ", "I", "'", "ve", " ", "chosen", " ", "a", " ", "'", "fac", "ade", "'", " ", "node", " ", "sinc", "e", " ", "it", "\\", "10", ";", " ", " ", " ", " ", "doe", "sn", "'", "t", " ", "have", " ", "too", " ", "muc", "h", " ", "overhead", " ", "and", " ", "won", "'", "t", " ", "get", " ", "delete", "d", " ", "if", " ", "the", " ", "user", "\\", "10", ";", " ", " ", " ", " ", "optimize", "s", " ", "the", " ", "scen", "e", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Not", "e", " ", "tha", "t", " ", "we", " ", "don", "'", "t", " ", "want", " ", "to", " ", "use", " ", "Maya", " ", "command", "s", " ", "here", " ", "bec", "aus", "e", " ", "the", "y", "\\", "10", ";", " ", " ", " ", " ", "wou", "ld", " ", "poll", "ute", " ", "Maya", "'", "s", " ", "undo", " ", "queue", ",", " ", "so", " ", "we", " ", "use", " ", "API", " ", "calls", " ", "inst", "ead", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ns_", "=_", "api_", "._", "MN", "ames", "pace_", "._", "current", "Namespace_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "api_", "._", "MN", "ames", "pace_", "._", "set", "Curr", "ent", "Namespace_", "(_", "':'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flush", "Und", "o_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dg", "mod_", "=_", "api_", "._", "MD", "GM", "odi", "fier", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "undo", "Node_", "=_", "dg", "mod_", "._", "create", "Node_", "(_", "'", "fac", "ade", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dg", "mod_", "._", "rename", "Node_", "(_", "self_", "._", "undo", "Node_", ",_", "self_", "._", "node", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dg", "mod_", "._", "do", "It_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "api_", "._", "MN", "ames", "pace_", "._", "set", "Curr", "ent", "Namespace_", "(_", "ns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "an", " ", "attribute", " ", "to", " ", "keep", " ", "a", " ", "count", " ", "of", " ", "the", " ", "command", "s", " ", "in", " ", "the", " ", "stack", "._", "\\u\\u\\uNL\\u\\u\\u_", "attr", "Fn_", "=_", "api_", "._", "MF", "n", "Numer", "ic", "Attribute_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "cmd", "Count", "Attr_", "=_", "attr", "Fn_", "._", "create_", "(_", "'", "cmd", "Count", "'_", ",_", "'", "cc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "api_", "._", "MF", "n", "Numer", "ic", "Data_", "._", "k", "Int_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "node", "Fn_", "=_", "api_", "._", "MF", "n", "Dependenc", "y", "Node_", "(_", "self_", "._", "undo", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "node", "\\u", "name_", "=_", "node", "Fn_", "._", "name_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "Fn_", "._", "add", "Attribute_", "(_", "self_", "._", "cmd", "Count", "Attr_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "node", "Fn_", "._", "set", "Do", "Not", "Write_", "(_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "node", "Fn_", "._", "set", "Locke", "d_", "(_", "True_", ")_", "\\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 ", " _", "api_", "._", "MM", "essage_", "._", "remove", "Callback_", "(_", "self_", "._", "cb", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "self_", "._", "cb", "id_", ",_", "'", "dis", "own", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cb", "id_", "._", "dis", "own_", "(_", ")_", "\\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_", "self_", "._", "cb", "id_", "=_", "api_", "._", "MN", "ode", "Message_", "._", "add", "Attribute", "Change", "d", "Callback_", "(_", "self_", "._", "undo", "Node_", ",_", "self_", "._", "\\u", "attr", "Changed_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ap", "i", "Und", "o_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "append_", "(_", "self_", ",_", "cmd", "Obj_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "cb", "\\u", "enabled_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "if", " ", "not", " ", "cmds", ".", "obj", "Exist", "s", "(", " ", "self", ".", "node", "\\u", "name", " ", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "self", ".\\u", "create", "Node", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Increment", " ", "the", " ", "undo", " ", "node", "'", "s", " ", "command", " ", "count", ".", " ", "We", " ", "want", " ", "this", " ", "to", " ", "go", " ", "into_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Maya", "'", "s", " ", "undo", " ", "queue", " ", "bec", "aus", "e", " ", "change", "s", " ", "to", " ", "this", " ", "attr", " ", "will", " ", "trigger", " ", "our", " ", "own_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "undo", "/", "redo", " ", "code", "._", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count_", "=_", "cmds_", "._", "get", "Attr_", "(_", "self_", "._", "node", "\\u", "name_", "+_", "'.", "cmd", "Count", "'_", ")_", "\\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_", "._", "\\u", "create", "Node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "count_", "=_", "cmds_", "._", "get", "Attr_", "(_", "self_", "._", "node", "\\u", "name_", "+_", "'.", "cmd", "Count", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cmds_", "._", "set", "Attr_", "(_", "self_", "._", "node", "\\u", "name_", "+_", "'.", "cmd", "Count", "'_", ",_", "count_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Append", " ", "the", " ", "command", " ", "to", " ", "the", " ", "end", " ", "of", " ", "the", " ", "undo", " ", "queue", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "undo", "\\u", "queue_", "._", "append_", "(_", "cmd", "Obj_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Clear", " ", "the", " ", "redo", " ", "queue", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "redo", "\\u", "queue_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Re", "-", "enable", " ", "the", " ", "callback", "._", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "cb", "\\u", "enabled_", "=_", "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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Modification of parameter with default
alias1/sparty/sparty_v_0.1.py
[ { "content": "def build_target(target, front_dirs=[],refine_target=[]):\n for item in front_dirs:\n refine_target.append(target+ \"/\"+ item)", "metadata": "root.build_target", "header": "['module', '___EOS___']", "index": 140 } ]
[ { "span": "refine_target.", "start_line": 142, "start_column": 24, "end_line": 142, "end_column": 37 } ]
[ { "span": "refine_target=", "start_line": 140, "start_column": 39, "end_line": 140, "end_column": 52 } ]
1
true
[ "[CLS]_", "Modifica", "tion_", "of_", "parameter_", "with_", "default_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "build", "\\u", "target_", "(_", "target_", ",_", "front", "\\u", "dirs_", "=_", "[_", "]_", ",_", "refine", "\\u", "target_", "=_", "[_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "item_", "in_", "front", "\\u", "dirs_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "refine", "\\u", "target_", "._", "append_", "(_", "target_", "+_", "\"/\"_", "+_", "item_", ")_", "\\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, 3, 1, 1, 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 ]
Unused import
pybrain/pybrain/pybrain/structure/modules/__init__.py
[ { "content": "from pybrain.structure.modules.biasunit import BiasUnit\nfrom pybrain.structure.modules.gate import GateLayer, DoubleGateLayer, MultiplicationLayer, SwitchLayer\nfrom pybrain.structure.modules.gaussianlayer import GaussianLayer\nfrom pybrain.structure.modules.linearlayer import LinearLayer\nfrom pybrain.structure.modules.lstm import LSTMLayer\nfrom pybrain.structure.modules.mdlstm import MDLSTMLayer\nfrom pybrain.structure.modules.mdrnnlayer import MdrnnLayer\nfrom pybrain.structure.modules.sigmoidlayer import SigmoidLayer\nfrom pybrain.structure.modules.softmax import SoftmaxLayer, PartialSoftmaxLayer\nfrom pybrain.structure.modules.statedependentlayer import StateDependentLayer\nfrom pybrain.structure.modules.tanhlayer import TanhLayer\nfrom pybrain.structure.modules.kohonen import KohonenMap\nfrom pybrain.structure.modules.table import Table\nfrom pybrain.structure.modules.module import Module\nfrom pybrain.structure.modules.relulayer import ReluLayer\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from pybrain.structure.modules.biasunit import BiasUnit", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 55 }, { "span": "from pybrain.structure.modules.gate import GateLayer, DoubleGateLayer, MultiplicationLayer, SwitchLayer", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 103 }, { "span": "from pybrain.structure.modules.gaussianlayer import GaussianLayer", "start_line": 2, "start_column": 0, "end_line": 2, "end_column": 65 }, { "span": "from pybrain.structure.modules.linearlayer import LinearLayer", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 61 }, { "span": "from pybrain.structure.modules.lstm import LSTMLayer", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 52 }, { "span": "from pybrain.structure.modules.mdlstm import MDLSTMLayer", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 56 }, { "span": "from pybrain.structure.modules.mdrnnlayer import MdrnnLayer", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 59 }, { "span": "from pybrain.structure.modules.sigmoidlayer import SigmoidLayer", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 63 }, { "span": "from pybrain.structure.modules.softmax import SoftmaxLayer, PartialSoftmaxLayer", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 79 }, { "span": "from pybrain.structure.modules.statedependentlayer import StateDependentLayer", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 77 }, { "span": "from pybrain.structure.modules.tanhlayer import TanhLayer", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 57 }, { "span": "from pybrain.structure.modules.kohonen import KohonenMap", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 56 }, { "span": "from pybrain.structure.modules.table import Table", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 49 }, { "span": "from pybrain.structure.modules.module import Module", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 51 }, { "span": "from pybrain.structure.modules.relulayer import ReluLayer", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 57 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "pyb", "rain_", "._", "structure_", "._", "modules_", "._", "bias", "unit_", "import_", "Bia", "s", "Unit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "structure_", "._", "modules_", "._", "gate_", "import_", "Gat", "e", "Layer_", ",_", "Doub", "le", "Gat", "e", "Layer_", ",_", "Multipl", "ication", "Layer_", ",_", "Switch", "Layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "structure_", "._", "modules_", "._", "gauss", "ian", "layer_", "import_", "Gaussian", "Layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "structure_", "._", "modules_", "._", "linear", "layer_", "import_", "Linea", "r", "Layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "structure_", "._", "modules_", "._", "lstm", "_", "import_", "LSTM", "Layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "structure_", "._", "modules_", "._", "mdl", "stm", "_", "import_", "MD", "LSTM", "Layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "structure_", "._", "modules_", "._", "md", "rn", "nla", "yer_", "import_", "Md", "rn", "n", "Layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "structure_", "._", "modules_", "._", "sigm", "oid", "layer_", "import_", "Sigm", "oid", "Layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "structure_", "._", "modules_", "._", "softmax_", "import_", "Softmax", "Layer_", ",_", "Parti", "al", "Softmax", "Layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "structure_", "._", "modules_", "._", "state", "dependent", "layer_", "import_", "State", "Dependent", "Layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "structure_", "._", "modules_", "._", "tan", "hla", "yer_", "import_", "Tan", "h", "Layer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "structure_", "._", "modules_", "._", "ko", "hone", "n_", "import_", "Ko", "hone", "n", "Map_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "structure_", "._", "modules_", "._", "table_", "import_", "Table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "structure_", "._", "modules_", "._", "module_", "import_", "Module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "pyb", "rain_", "._", "structure_", "._", "modules_", "._", "relu", "layer_", "import_", "Rel", "u", "Layer_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 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, 2, 0, 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, 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, 1, 1, 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, 1, 1, 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, 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, 2, 0, 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 ]
Unused import
learntextvis/textkit/tests/test_filter.py
[ { "content": "import click\nfrom click.testing import CliRunner\nfrom textkit.filter.filter_punc import filterpunc\nfrom textkit.filter.filter_words import filterwords\nfrom textkit.filter.filter_lengths import filterlengths\nfrom tests.utils import create_single_output, create_multifile_output, compare_results\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def test_filterlengths():\n runner = CliRunner()\n with runner.isolated_filesystem():\n filename = 'in.txt'\n sentence = 'Hello\\nWorld\\n!\\nI\\n.\\nnot\\nwin\\n'\n \n create_single_output(filename, sentence)\n \n # default length 3\n result = runner.invoke(filterlengths, [filename])\n tokens = result.output.split('\\n')\n expected_tokens = ['Hello', 'World', 'not', 'win'] \n assert result.exit_code == 0\n compare_results(tokens, expected_tokens)\n\n # minumum length 4\n result = runner.invoke(filterlengths, ['-m', '4', filename])\n tokens = result.output.split('\\n')\n expected_tokens = ['Hello', 'World']\n assert result.exit_code == 0\n compare_results(tokens, expected_tokens)", "metadata": "root.test_filterlengths", "header": "['module', '___EOS___']", "index": 7 }, { "content": "def test_filterpunc():\n runner = CliRunner()\n with runner.isolated_filesystem():\n filename = 'in.txt'\n sentence = 'Hello\\nWorld\\n!\\nI\\n.\\nnot'\n expected_tokens = ['Hello', 'World', 'I', 'not']\n create_single_output(filename, sentence)\n result = runner.invoke(filterpunc, [filename])\n tokens = result.output.split('\\n')\n assert result.exit_code == 0\n compare_results(tokens, expected_tokens)", "metadata": "root.test_filterpunc", "header": "['module', '___EOS___']", "index": 30 }, { "content": "def test_filterwords():\n runner = CliRunner()\n with runner.isolated_filesystem():\n\n filename = 'in.txt'\n sentence = 'Hello\\nWorld\\n!\\nI\\nam\\nnot\\na\\ncrook\\n.'\n expected_tokens = ['Hello','World','!', 'crook','.']\n create_single_output(filename, sentence)\n result = runner.invoke(filterwords, ['--language', 'english', filename])\n tokens = result.output.split('\\n')\n assert result.exit_code == 0\n compare_results(tokens, expected_tokens)", "metadata": "root.test_filterwords", "header": "['module', '___EOS___']", "index": 43 }, { "content": "def test_filterwords_custom():\n runner = CliRunner()\n with runner.isolated_filesystem():\n\n filename = 'in.txt'\n sentence = 'Hello\\nWorld\\n!\\nI\\nam\\nnot\\na\\ncrook\\n.'\n expected_tokens = ['World','!','crook','.']\n custom_stopword_filename = 'custom.txt'\n custom_stopwords = 'hello\\n'\n\n create_single_output(filename, sentence)\n create_single_output(custom_stopword_filename, custom_stopwords)\n\n result = runner.invoke(filterwords, ['--custom', 'custom.txt', filename])\n tokens = result.output.split('\\n')\n assert result.exit_code == 0\n compare_results(tokens, expected_tokens)", "metadata": "root.test_filterwords_custom", "header": "['module', '___EOS___']", "index": 57 } ]
[ { "span": "import click", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 12 }, { "span": "from tests.utils import create_single_output, create_multifile_output, compare_results", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 86 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "click_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "click_", "._", "testing_", "import_", "Cli", "Runner_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "text", "kit_", "._", "filter_", "._", "filter", "\\u", "punc", "_", "import_", "filter", "punc", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "text", "kit_", "._", "filter_", "._", "filter", "\\u", "words_", "import_", "filterw", "ords_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "text", "kit_", "._", "filter_", "._", "filter", "\\u", "lengths_", "import_", "filter", "lengths_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tests_", "._", "utils_", "import_", "create", "\\u", "single", "\\u", "output_", ",_", "create", "\\u", "multi", "file", "\\u", "output_", ",_", "compare", "\\u", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "filter", "lengths_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "runner_", "=_", "Cli", "Runner_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "runner_", "._", "isolated", "\\u", "filesystem_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "'", "in", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sentence_", "=_", "'", "Hell", "o", "\\\\", "n", "Wor", "ld", "\\\\", "n", "!\\\\", "n", "I", "\\\\", "n", ".\\\\", "nno", "t", "\\\\", "nwi", "n", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "create", "\\u", "single", "\\u", "output_", "(_", "filename_", ",_", "sentence_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "default", " ", "length", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "runner_", "._", "invoke_", "(_", "filter", "lengths_", ",_", "[_", "filename_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tokens_", "=_", "result_", "._", "output_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "tokens_", "=_", "[_", "'", "Hell", "o", "'_", ",_", "'", "Wor", "ld", "'_", ",_", "'", "not", "'_", ",_", "'", "win", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "._", "exit", "\\u", "code_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "\\u", "results_", "(_", "tokens_", ",_", "expected", "\\u", "tokens_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "minu", "mum", " ", "length", " ", "4_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "runner_", "._", "invoke_", "(_", "filter", "lengths_", ",_", "[_", "'-", "m", "'_", ",_", "'", "4", "'_", ",_", "filename_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tokens_", "=_", "result_", "._", "output_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "tokens_", "=_", "[_", "'", "Hell", "o", "'_", ",_", "'", "Wor", "ld", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "._", "exit", "\\u", "code_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "\\u", "results_", "(_", "tokens_", ",_", "expected", "\\u", "tokens_", ")_", "\\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_", "test\\u", "filter", "punc", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "runner_", "=_", "Cli", "Runner_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "runner_", "._", "isolated", "\\u", "filesystem_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "'", "in", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sentence_", "=_", "'", "Hell", "o", "\\\\", "n", "Wor", "ld", "\\\\", "n", "!\\\\", "n", "I", "\\\\", "n", ".\\\\", "nno", "t", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "tokens_", "=_", "[_", "'", "Hell", "o", "'_", ",_", "'", "Wor", "ld", "'_", ",_", "'", "I", "'_", ",_", "'", "not", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "single", "\\u", "output_", "(_", "filename_", ",_", "sentence_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "runner_", "._", "invoke_", "(_", "filter", "punc", "_", ",_", "[_", "filename_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tokens_", "=_", "result_", "._", "output_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "._", "exit", "\\u", "code_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "\\u", "results_", "(_", "tokens_", ",_", "expected", "\\u", "tokens_", ")_", "\\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_", "test\\u", "filterw", "ords_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "runner_", "=_", "Cli", "Runner_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "runner_", "._", "isolated", "\\u", "filesystem_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "'", "in", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sentence_", "=_", "'", "Hell", "o", "\\\\", "n", "Wor", "ld", "\\\\", "n", "!\\\\", "n", "I", "\\\\", "nam", "\\\\", "nno", "t", "\\\\", "na", "\\\\", "ncr", "ook", "\\\\", "n", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "tokens_", "=_", "[_", "'", "Hell", "o", "'_", ",_", "'", "Wor", "ld", "'_", ",_", "'!'_", ",_", "'", "cro", "ok", "'_", ",_", "'.'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "single", "\\u", "output_", "(_", "filename_", ",_", "sentence_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "runner_", "._", "invoke_", "(_", "filterw", "ords_", ",_", "[_", "'--", "language", "'_", ",_", "'", "english", "'_", ",_", "filename_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tokens_", "=_", "result_", "._", "output_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "._", "exit", "\\u", "code_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "\\u", "results_", "(_", "tokens_", ",_", "expected", "\\u", "tokens_", ")_", "\\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_", "test\\u", "filterw", "ords", "\\u", "custom_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "runner_", "=_", "Cli", "Runner_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "runner_", "._", "isolated", "\\u", "filesystem_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "filename_", "=_", "'", "in", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sentence_", "=_", "'", "Hell", "o", "\\\\", "n", "Wor", "ld", "\\\\", "n", "!\\\\", "n", "I", "\\\\", "nam", "\\\\", "nno", "t", "\\\\", "na", "\\\\", "ncr", "ook", "\\\\", "n", ".'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expected", "\\u", "tokens_", "=_", "[_", "'", "Wor", "ld", "'_", ",_", "'!'_", ",_", "'", "cro", "ok", "'_", ",_", "'.'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "custom", "\\u", "stopword", "\\u", "filename_", "=_", "'", "custom", ".", "txt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "custom", "\\u", "stopwords_", "=_", "'", "hell", "o", "\\\\", "n", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "create", "\\u", "single", "\\u", "output_", "(_", "filename_", ",_", "sentence_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "create", "\\u", "single", "\\u", "output_", "(_", "custom", "\\u", "stopword", "\\u", "filename_", ",_", "custom", "\\u", "stopwords_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "runner_", "._", "invoke_", "(_", "filterw", "ords_", ",_", "[_", "'--", "custom", "'_", ",_", "'", "custom", ".", "txt", "'_", ",_", "filename_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tokens_", "=_", "result_", "._", "output_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "result_", "._", "exit", "\\u", "code_", "==_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "compare", "\\u", "results_", "(_", "tokens_", ",_", "expected", "\\u", "tokens_", ")_" ]
[ 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, 0, 1, 1, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
andrew-gardner/dependsworkflow/depends/depends_data_packet.py
[ { "content": "#\n# Depends\n# Copyright (C) 2014 by Andrew Gardner & Jonas Unger. All rights reserved.\n# BSD license (LICENSE.txt for details).\n#\n\nimport os\nimport re\nimport uuid\n\nimport depends_node\nimport depends_util\n\n\n\"\"\"\nA data packet is the absolute minimum amount of information needed to represent\na knowable-thing on disk. Each datapacket can represent a single item or a\nsequence of items.\n\nOnly file information is transferred in a DataPacket, and only file information\nshould ever be transferred. Other values that should be shared between nodes\nshould happen through the variable substitution mechanisms.\n\"\"\"\n\n\n###############################################################################\n## Utility\n###############################################################################\n\n\n\n\n\n\n\n\n \n\n# TODO: A function to get the type name without needing to create the class?\n\n\n###############################################################################\n## DataPacket base class\n###############################################################################\n\n\n######## FUNCTION TO IMPORT PLUGIN DATA PACKETS INTO THIS NAMESPACE ##########\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def filenameDictForDataPacketType(dataPacketType):\n \"\"\"\n Return a dict of fileDescriptors for a given DataPacket type.\n \"\"\"\n foo = dataPacketType(None, None)\n return foo.filenames", "metadata": "root.filenameDictForDataPacketType", "header": "['module', '___EOS___']", "index": 28 }, { "content": "def scenegraphLocationString(dataPacket):\n \"\"\"\n Given a datapacket, return a string representing its location in the \n scenegraph. (::UUID:OUTPUT)\n \"\"\"\n return \"::\"+str(dataPacket.sourceNode.uuid)+\":\"+dataPacket.sourceOutputName", "metadata": "root.scenegraphLocationString", "header": "['module', '___EOS___']", "index": 36 }, { "content": "def shorthandScenegraphLocationString(dataPacket):\n \"\"\"\n Given a datapacket, return a \"human-readable\" string representing its name\n in the scenegraph. (::NAME:OUTPUT)\n \"\"\"\n return \"::\"+dataPacket.sourceNode.name+\":\"+dataPacket.sourceOutputName", "metadata": "root.shorthandScenegraphLocationString", "header": "['module', '___EOS___']", "index": 44 }, { "content": "def uuidFromScenegraphLocationString(string):\n \"\"\"\n Returns a UUID object for a given scenegraph location string.\n \"\"\"\n if string == \"\":\n return None\n if not string.startswith(\"::\"):\n return None\n uuidString = string.split(\":\")[2]\n return uuid.UUID(uuidString)", "metadata": "root.uuidFromScenegraphLocationString", "header": "['module', '___EOS___']", "index": 52 }, { "content": "def nodeAndOutputFromScenegraphLocationString(string, dag):\n \"\"\"\n Returns a tuple containing the node defined in a location string and its \n corresponding Output.\n \"\"\"\n try:\n outputNodeUUID = uuidFromScenegraphLocationString(string)\n outputNode = dag.node(nUUID=outputNodeUUID)\n outputNodeOutputName = string.split(\":\")[3]\n return (outputNode, outputNode.outputNamed(outputNodeOutputName))\n except:\n return(None, None)", "metadata": "root.nodeAndOutputFromScenegraphLocationString", "header": "['module', '___EOS___']", "index": 64 }, { "content": "class DataPacket(object):\n \"\"\"\n The minimal amount of data needed to convey an object.\n The user may inherit from this class to define her own formats of data to\n pass around the DAG. Adding members to the filenames dictionary is all\n that is needed to make effective new DataPackets.\n \"\"\"\n\n \n # TODO: Be more explicit in this function name\n\n\n\n\n\n\n \n\n\n ", "metadata": "root.DataPacket", "header": "['module', '___EOS___']", "index": 84 }, { "content": " def __init__(self, sourceNode, sourceOutputName):\n self.filenames = dict()\n self.sourceNode = sourceNode\n self.sourceOutputName = sourceOutputName\n self.sequenceRange = None", "metadata": "root.DataPacket.__init__", "header": "['class', 'DataPacket', '(', 'object', ')', ':', '___EOS___']", "index": 91 }, { "content": " def typeStr(self):\n \"\"\"\n Returns a human-readable type string with CamelCaps->spaces.\n \"\"\"\n # TODO: MAKE EXPLICIT!\n return re.sub(r'(?!^)([A-Z]+)', r' \\1', type(self).__name__[len('DataPacket'):])", "metadata": "root.DataPacket.typeStr", "header": "['class', 'DataPacket', '(', 'object', ')', ':', '___EOS___']", "index": 99 }, { "content": " def setFilename(self, descriptorName, filename):\n \"\"\"\n Set the value of one of the files|sequences in this datapacket.\n \"\"\"\n if descriptorName not in self.filenames:\n raise RuntimeError(\"DataPacket %s does not contain a file descriptor named %s.\" % (shorthandScenegraphLocationString(self), descriptorName))\n self.filenames[descriptorName] = filename", "metadata": "root.DataPacket.setFilename", "header": "['class', 'DataPacket', '(', 'object', ')', ':', '___EOS___']", "index": 107 }, { "content": " def setSequenceRange(self, rangeTuple):\n \"\"\"\n Set the range for this datapacket. Takes a tuple containing start\n and end strings or ints. All ranges are stored internally as ints.\n \"\"\"\n # All sequence ranges are converted to integers here\n self.sequenceRange = None\n if rangeTuple:\n lowValue = int(rangeTuple[0]) if rangeTuple[0] else None\n highValue = int(rangeTuple[1]) if rangeTuple[1] else None\n self.sequenceRange = (lowValue, highValue)", "metadata": "root.DataPacket.setSequenceRange", "header": "['class', 'DataPacket', '(', 'object', ')', ':', '___EOS___']", "index": 116 }, { "content": " def fileDescriptorNamed(self, descriptorName):\n \"\"\"\n Return a framespec object derived from the information in the given\n descriptor.\n \"\"\"\n if descriptorName not in self.filenames:\n raise RuntimeError(\"DataPacket %s does not contain a file descriptor named %s.\" % (shorthandScenegraphLocationString(self), descriptorName))\n return depends_util.framespec(self.filenames[descriptorName], self.sequenceRange)", "metadata": "root.DataPacket.fileDescriptorNamed", "header": "['class', 'DataPacket', '(', 'object', ')', ':', '___EOS___']", "index": 129 }, { "content": " def dataPresent(self, specificFileDescriptorName=None):\n \"\"\"\n Returns if all data is present for the current DataPacket. Individual\n file descriptors in the data packet can be specified to retrieve more \n detailed information.\n \"\"\"\n fdNameList = list()\n if specificFileDescriptorName:\n fdNameList.append(specificFileDescriptorName)\n else:\n fdNameList = self.filenames.keys()\n for fileDescriptor in fdNameList:\n if not self._filesExist(depends_util.framespec(self.filenames[fileDescriptor], self.sequenceRange)):\n return False\n return True", "metadata": "root.DataPacket.dataPresent", "header": "['class', 'DataPacket', '(', 'object', ')', ':', '___EOS___']", "index": 139 }, { "content": " def _filesExist(self, framespecObject):\n \"\"\"\n Check if all files exist in a given framespec object.\n \"\"\"\n numFilesInList = len(framespecObject.frames())\n if numFilesInList == 0:\n return False\n for file in framespecObject.frames():\n if not os.path.exists(file):\n return False\n return True", "metadata": "root.DataPacket._filesExist", "header": "['class', 'DataPacket', '(', 'object', ')', ':', '___EOS___']", "index": 156 }, { "content": "def loadChildDataPacketsFromPaths(pathList):\n \"\"\"\n Given a list of directories, import all classes that inherit from DataPacket\n in those directories into the data_packet namespace.\n \"\"\"\n for path in pathList:\n dpClassDict = depends_util.allClassesOfInheritedTypeFromDir(path, DataPacket)\n for dpc in dpClassDict:\n globals()[dpc] = dpClassDict[dpc]", "metadata": "root.loadChildDataPacketsFromPaths", "header": "['module', '___EOS___']", "index": 170 } ]
[ { "span": "import depends_node", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 19 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Depend", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "C", ")", " ", "2014", " ", "by", " ", "Andre", "w", " ", "Gar", "dne", "r", " ", "&", " ", "Jon", "as", " ", "Un", "ger", ".", " ", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "BS", "D", " ", "license", " ", "(", "LICENSE", ".", "txt", " ", "for", " ", "deta", "il", "s", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "uuid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "depend", "s", "\\u", "node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "depend", "s", "\\u", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "A", " ", "data", " ", "packet", " ", "is", " ", "the", " ", "abs", "olute", " ", "minim", "um", " ", "amo", "unt", " ", "of", " ", "informati", "on", " ", "need", "ed", " ", "to", " ", "represent", "\\", "10", ";", "a", " ", "know", "able", "-", "thing", " ", "on", " ", "disk", ".", " ", " ", "Ea", "ch", " ", "datap", "acke", "t", " ", "can", " ", "represent", " ", "a", " ", "single", " ", "item", " ", "or", " ", "a", "\\", "10", ";", "sequence", " ", "of", " ", "items", ".", "\\", "10", ";", "\\", "10", ";", "On", "ly", " ", "file", " ", "informati", "on", " ", "is", " ", "transferred", " ", "in", " ", "a", " ", "Data", "Packe", "t", ",", " ", "and", " ", "only", " ", "file", " ", "informati", "on", "\\", "10", ";", "shou", "ld", " ", "ever", " ", "be", " ", "transferred", ".", " ", " ", "Ot", "her", " ", "values", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "shared", " ", "bet", "ween", " ", "nodes", "\\", "10", ";", "shou", "ld", " ", "happ", "en", " ", "through", " ", "the", " ", "variab", "le", " ", "substitution", " ", "mechanism", "s", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Utility_", "\\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_", "#", " ", "TOD", "O", ":", " ", "A", " ", "function", " ", "to", " ", "get", " ", "the", " ", "type", " ", "name", " ", "with", "out", " ", "need", "ing", " ", "to", " ", "create", " ", "the", " ", "class", "?", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "##", "_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "Data", "Packe", "t", " ", "base", " ", "class_", "\\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_", "######", "##", " ", "FUNC", "TIO", "N", " ", "TO", " ", "IMPORT", " ", "PLUGIN", " ", "DATA", " ", "PACKET", "S", " ", "INT", "O", " ", "THIS", " ", "NAMESPACE", " ", " ", "#########", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "filename", "Dict", "For", "Data", "Packe", "t", "Type_", "(_", "data", "Packe", "t", "Type_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "dict", " ", "of", " ", "file", "Descrip", "tors", " ", "for", " ", "a", " ", "give", "n", " ", "Data", "Packe", "t", " ", "type", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "foo_", "=_", "data", "Packe", "t", "Type_", "(_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "foo_", "._", "filenames_", "\\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_", "scen", "egr", "aph", "Locat", "ion", "String_", "(_", "data", "Packet_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Give", "n", " ", "a", " ", "datap", "acke", "t", ",", " ", "return", " ", "a", " ", "string", " ", "represent", "ing", " ", "its", " ", "location", " ", "in", " ", "the", " ", "\\", "10", ";", " ", " ", " ", " ", "scen", "egr", "aph", ".", " ", "(:", ":", "UU", "ID", ":", "OUTPU", "T", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\":", ":\"_", "+_", "str_", "(_", "data", "Packet_", "._", "source", "Node_", "._", "uuid_", ")_", "+_", "\":\"_", "+_", "data", "Packet_", "._", "source", "Output", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "short", "hand", "Scen", "egr", "aph", "Locat", "ion", "String_", "(_", "data", "Packet_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Give", "n", " ", "a", " ", "datap", "acke", "t", ",", " ", "return", " ", "a", " ", "\"", "human", "-", "reada", "ble", "\"", " ", "string", " ", "represent", "ing", " ", "its", " ", "name", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "the", " ", "scen", "egr", "aph", ".", " ", " ", "(:", ":", "NAME", ":", "OUTPU", "T", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\":", ":\"_", "+_", "data", "Packet_", "._", "source", "Node_", "._", "name_", "+_", "\":\"_", "+_", "data", "Packet_", "._", "source", "Output", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "uuid", "Fro", "m", "Scen", "egr", "aph", "Locat", "ion", "String_", "(_", "string_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "UU", "ID", " ", "object", " ", "for", " ", "a", " ", "give", "n", " ", "scen", "egr", "aph", " ", "location", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "string_", "==_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "string_", "._", "startswith_", "(_", "\":", ":\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "uuid", "String_", "=_", "string_", "._", "split_", "(_", "\":\"_", ")_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "uuid_", "._", "UUID_", "(_", "uuid", "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_", "def_", "node", "And", "Output", "Fro", "m", "Scen", "egr", "aph", "Locat", "ion", "String_", "(_", "string_", ",_", "dag_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "tuple", " ", "contain", "ing", " ", "the", " ", "node", " ", "defin", "ed", " ", "in", " ", "a", " ", "location", " ", "string", " ", "and", " ", "its", " ", "\\", "10", ";", " ", " ", " ", " ", "correspond", "ing", " ", "Output", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "output", "Node", "UUID_", "=_", "uuid", "Fro", "m", "Scen", "egr", "aph", "Locat", "ion", "String_", "(_", "string_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "Node_", "=_", "dag_", "._", "node_", "(_", "n", "UUID_", "=_", "output", "Node", "UUID_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "output", "Node", "Output", "Name_", "=_", "string_", "._", "split_", "(_", "\":\"_", ")_", "[_", "3_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "(_", "output", "Node_", ",_", "output", "Node_", "._", "output", "Name", "d_", "(_", "output", "Node", "Output", "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 ", " _", "return_", "(_", "None_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Data", "Packet_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "minima", "l", " ", "amo", "unt", " ", "of", " ", "data", " ", "need", "ed", " ", "to", " ", "conve", "y", " ", "an", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "user", " ", "may", " ", "inherit", " ", "from", " ", "this", " ", "class", " ", "to", " ", "defin", "e", " ", "her", " ", "own", " ", "formats", " ", "of", " ", "data", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "pass", " ", "aro", "und", " ", "the", " ", "DAG", ".", " ", " ", "Add", "ing", " ", "member", "s", " ", "to", " ", "the", " ", "filename", "s", " ", "dictionar", "y", " ", "is", " ", "all", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "is", " ", "need", "ed", " ", "to", " ", "make", " ", "effective", " ", "new", " ", "Data", "Packe", "ts", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "Be", " ", "more", " ", "explicit", " ", "in", " ", "this", " ", "function", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Data", "Packet_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "source", "Node_", ",_", "source", "Output", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "filenames_", "=_", "dict_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source", "Node_", "=_", "source", "Node_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "source", "Output", "Name_", "=_", "source", "Output", "Name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sequence", "Range_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Packet_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "type", "Str_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "human", "-", "reada", "ble", " ", "type", " ", "string", " ", "with", " ", "Came", "l", "Caps", "->", "space", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TOD", "O", ":", " ", "MAKE", " ", "EXPL", "ICIT", "!", "_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "re_", "._", "sub_", "(_", "r", "'(", "?!", "^", ")(", "[", "A", "-", "Z", "]+)'_", ",_", "r", "'", " ", "\\\\", "1", "'_", ",_", "type_", "(_", "self_", ")_", "._", "\\u\\u", "name\\u\\u_", "[_", "len_", "(_", "'", "Data", "Packe", "t", "'_", ")_", ":_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Packet_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Filename_", "(_", "self_", ",_", "descrip", "tor", "Name_", ",_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "the", " ", "value", " ", "of", " ", "one", " ", "of", " ", "the", " ", "files", "|", "sequence", "s", " ", "in", " ", "this", " ", "datap", "acke", "t", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "descrip", "tor", "Name_", "not_", "in_", "self_", "._", "filenames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", "\"", "Data", "Packe", "t", " ", "%", "s", " ", "doe", "s", " ", "not", " ", "contain", " ", "a", " ", "file", " ", "descrip", "tor", " ", "named", " ", "%", "s", ".\"_", "%_", "(_", "short", "hand", "Scen", "egr", "aph", "Locat", "ion", "String_", "(_", "self_", ")_", ",_", "descrip", "tor", "Name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "filenames_", "[_", "descrip", "tor", "Name_", "]_", "=_", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Packet_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Sequ", "ence", "Range_", "(_", "self_", ",_", "range", "Tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "the", " ", "range", " ", "for", " ", "this", " ", "datap", "acke", "t", ".", " ", " ", "Tak", "es", " ", "a", " ", "tuple", " ", "contain", "ing", " ", "start", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "end", " ", "string", "s", " ", "or", " ", "ints", ".", " ", " ", "All", " ", "ranges", " ", "are", " ", "store", "d", " ", "internal", "ly", " ", "as", " ", "ints", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "All", " ", "sequence", " ", "ranges", " ", "are", " ", "convert", "ed", " ", "to", " ", "integ", "ers", " ", "here_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "sequence", "Range_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "range", "Tuple_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "low", "Value_", "=_", "int_", "(_", "range", "Tuple_", "[_", "0_", "]_", ")_", "if_", "range", "Tuple_", "[_", "0_", "]_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "high", "Value_", "=_", "int_", "(_", "range", "Tuple_", "[_", "1_", "]_", ")_", "if_", "range", "Tuple_", "[_", "1_", "]_", "else_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "sequence", "Range_", "=_", "(_", "low", "Value_", ",_", "high", "Value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Packet_", "(_", "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_", "file", "Descrip", "tor", "Name", "d_", "(_", "self_", ",_", "descrip", "tor", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "frames", "pec", " ", "object", " ", "derive", "d", " ", "from", " ", "the", " ", "informati", "on", " ", "in", " ", "the", " ", "give", "n", "\\", "10", ";", " ", " ", " ", " ", "descrip", "tor", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "descrip", "tor", "Name_", "not_", "in_", "self_", "._", "filenames_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Run", "time", "Error_", "(_", "\"", "Data", "Packe", "t", " ", "%", "s", " ", "doe", "s", " ", "not", " ", "contain", " ", "a", " ", "file", " ", "descrip", "tor", " ", "named", " ", "%", "s", ".\"_", "%_", "(_", "short", "hand", "Scen", "egr", "aph", "Locat", "ion", "String_", "(_", "self_", ")_", ",_", "descrip", "tor", "Name_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "depend", "s", "\\u", "util_", "._", "frames", "pec_", "(_", "self_", "._", "filenames_", "[_", "descrip", "tor", "Name_", "]_", ",_", "self_", "._", "sequence", "Range_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Data", "Packet_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "data", "Present_", "(_", "self_", ",_", "specific", "File", "Descrip", "tor", "Name_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "if", " ", "all", " ", "data", " ", "is", " ", "presen", "t", " ", "for", " ", "the", " ", "current", " ", "Data", "Packe", "t", ".", " ", " ", "Individual", "\\", "10", ";", " ", " ", " ", " ", "file", " ", "descrip", "tors", " ", "in", " ", "the", " ", "data", " ", "packet", " ", "can", " ", "be", " ", "specified", " ", "to", " ", "retrieve", " ", "more", " ", "\\", "10", ";", " ", " ", " ", " ", "detailed", " ", "informati", "on", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fd", "Name", "List_", "=_", "list_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "specific", "File", "Descrip", "tor", "Name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fd", "Name", "List_", "._", "append_", "(_", "specific", "File", "Descrip", "tor", "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 ", " _", "fd", "Name", "List_", "=_", "self_", "._", "filenames_", "._", "keys_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "file", "Descriptor_", "in_", "fd", "Name", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "\\u", "files", "Exist_", "(_", "depend", "s", "\\u", "util_", "._", "frames", "pec_", "(_", "self_", "._", "filenames_", "[_", "file", "Descriptor_", "]_", ",_", "self_", "._", "sequence", "Range_", ")_", ")_", ":_", "\\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]_", "class_", "Data", "Packet_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "files", "Exist_", "(_", "self_", ",_", "frames", "pec", "Object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Check", " ", "if", " ", "all", " ", "files", " ", "exist", " ", "in", " ", "a", " ", "give", "n", " ", "frames", "pec", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "Files", "In", "List_", "=_", "len_", "(_", "frames", "pec", "Object_", "._", "frames_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "num", "Files", "In", "List_", "==_", "0_", ":_", "\\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_", "for_", "file_", "in_", "frames", "pec", "Object_", "._", "frames_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "os_", "._", "path_", "._", "exists_", "(_", "file_", ")_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "Chil", "d", "Data", "Packe", "ts", "Fro", "m", "Paths_", "(_", "path", "List_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Give", "n", " ", "a", " ", "list", " ", "of", " ", "director", "ies", ",", " ", "import", " ", "all", " ", "classe", "s", " ", "tha", "t", " ", "inherit", " ", "from", " ", "Data", "Packe", "t", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "tho", "se", " ", "director", "ies", " ", "int", "o", " ", "the", " ", "data\\u", "packet", " ", "namespace", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "path_", "in_", "path", "List_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "dp", "Class", "Dict_", "=_", "depend", "s", "\\u", "util_", "._", "all", "Class", "es", "Of", "Inherit", "ed", "Type", "Fro", "m", "Dir_", "(_", "path_", ",_", "Data", "Packet_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "dp", "c_", "in_", "dp", "Class", "Dict_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "globals_", "(_", ")_", "[_", "dp", "c_", "]_", "=_", "dp", "Class", "Dict_", "[_", "dp", "c_", "]_" ]
[ 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, 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, 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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 ]
Except block handles 'BaseException'
bradwright/mnml/mnml.py
[ { "content": " def dev_run(self, port=8000):\n from wsgiref.simple_server import make_server\n server = make_server('', port, self)\n print 'MNML now running on http://127.0.0.1:%s\\n' % port\n try:\n server.serve_forever()\n except:\n print 'MNML stopping...'\n server.socket.close()", "metadata": "root.WebApplication.dev_run", "header": "['class', 'WebApplication', '(', 'object', ')', ':', '___EOS___']", "index": 213 } ]
[ { "span": "except:", "start_line": 219, "start_column": 8, "end_line": 219, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Web", "Application_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dev", "\\u", "run_", "(_", "self_", ",_", "port_", "=_", "8000_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "wsgi", "ref_", "._", "simple", "\\u", "server_", "import_", "make", "\\u", "server_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server_", "=_", "make", "\\u", "server_", "(_", "''_", ",_", "port_", ",_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "MN", "ML", " ", "now", " ", "runn", "ing", " ", "on", " ", "http", "://", "127", ".0", ".0", ".1", ":", "%", "s", "\\\\", "n", "'_", "%_", "port_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "server_", "._", "serve", "\\u", "forever_", "(_", ")_", "\\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_", "'", "MN", "ML", " ", "stopping", "...'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "server_", "._", "socket_", "._", "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, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
CGATOxford/cgat/obsolete/gff2wiggle_stats.py
[ { "content": "################################################################################\n#\n# MRC FGU Computational Genomics Group\n#\n# $Id$\n#\n# Copyright (C) 2009 Andreas Heger\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n#################################################################################\n'''\ngff2wiggle_stats.py - compute coverage of intervals\n===================================================\n\n:Author: Andreas Heger\n:Release: $Id$\n:Date: |today|\n:Tags: Python\n\nPurpose\n-------\n\nThis script builds a :term:`wiggle` file from a :term:`gff` formatted\nfile by stacking the intervals in the :term:`gff` formatted file on\ntop of each other. The value in the :term:`wiggle` file is the height\nof the stack.\n\nUsage\n-----\n\nExample::\n\n python gff2wiggle_stats.py --help\n\nType::\n\n python gff2wiggle_stats.py --help\n\nfor command line help.\n\nDocumentation\n-------------\n\nCode\n----\n\n'''\n\nimport sys\nimport re\nimport string\nimport optparse\nimport time\nimport os\nimport glob\n\nimport CGAT.Experiment as E\nimport CGAT.Stats as Stats\nimport CGAT.GTF as GTF\n\nimport CGAT.Wiggle as Wiggle\nimport alignlib\n\nif __name__ == '__main__':\n\n parser = E.OptionParser( version = \"%prog version: $Id: gff2wiggle_stats.py 2781 2009-09-10 11:33:14Z andreas $\", usage = globals()[\"__doc__\"] )\n\n parser.add_option(\"-g\", \"--genome-file\", dest=\"genome_file\", type=\"string\",\n help=\"filename with genome.\" )\n\n parser.add_option(\"--wiggle-files\", dest=\"wiggle_files\", type=\"string\",\n help=\"glob expression for wiggle files [%default].\" )\n\n parser.add_option(\"--prefix\", dest=\"prefix\", type=\"string\",\n help=\"prefix to add to contig names before lookup [%default].\" )\n\n parser.add_option( \"-a\", \"--as-gtf\", dest=\"as_gtf\", action=\"store_true\",\n help=\"input is in gtf format.\")\n\n parser.add_option( \"--test\", dest=\"test\", type=\"int\",\n help=\"test - stop after # rows of parsing [%default].\" )\n\n parser.add_option( \"--with-values\", dest=\"with_values\", action=\"store_true\",\n help=\"output values in last column [%default].\" )\n\n parser.set_defaults( wiggle_files = \"*.data.bz2\",\n prefix = \"\",\n with_values = False,\n test = None )\n\n (options, args) = E.Start( parser, add_pipe_options = True )\n\n # open indexed access to wiggles\n wiggle_files = glob.glob( options.wiggle_files )\n if not wiggle_files:\n raise IOError( \"could not find wiggle files with '%s'\" % options.wiggle_files )\n\n index = Wiggle.WiggleMultiIndexedAccess( wiggle_files,\n keep_open = True,\n use_cache = False )\n\n if options.as_gtf:\n iterator = GTF.flat_gene_iterator( GTF.iterator( sys.stdin) )\n id = \"gene_id\"\n else:\n iterator = GTF.chunk_iterator( GTF.iterator( sys.stdin ) )\n id = \"query\"\n\n ninput, noutput, nskipped = 0, 0, 0\n\n options.stdout.write( \"%s\\tnali\\t%s\" % (id, \"\\t\".join( Stats.DistributionalParameters().getHeaders() )))\n if options.with_values:\n options.stdout.write( \"\\tvalues\" )\n options.stdout.write(\"\\n\" )\n\n for gffs in iterator:\n\n if options.test and ninput >= options.test:\n break\n\n ninput += 1\n \n if options.loglevel >= 2:\n for gff in gffs:\n options.stdlog.write( str(gff) + \"\\n\" )\n\n map_genome2query = alignlib.makeAlignmentBlocks()\n for gff in gffs:\n map_genome2query.addDiagonal( gff.start, gff.end, 0 )\n\n data = index.get( options.prefix + gff.contig,\n map_genome2query.getRowFrom(),\n map_genome2query.getRowTo() )\n\n values = []\n for x, vv in data:\n for v in vv:\n if map_genome2query.mapRowToCol( x ) >= 0:\n values.append( v )\n x += 1\n if len(values) == 0:\n nskipped += 1\n continue\n \n noutput += 1\n\n if options.loglevel >= 2:\n options.stdlog.write( \"# %s\\n\" % \",\".join( [ \"%5.3f\" % v for v in values] ))\n\n s = Stats.DistributionalParameters( values )\n if options.as_gtf:\n id = gff.gene_id\n else:\n id = gff.mAttributes\n options.stdout.write( \"%s\\t%i\\t%s\" % ( id,\n map_genome2query.getNumAligned(),\n str( s ) ) )\n \n if options.with_values:\n options.stdout.write( \"\\t%s\" % \",\".join( [ \"%5.3f\" % v for v in values] ))\n \n options.stdout.write(\"\\n\" ) \n\n if options.loglevel >= 1:\n options.stdlog.write( \"# ninput=%i, noutput=%i, nskipped=%i\\n\" % (ninput, noutput, nskipped) )\n\n E.Stop()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "import re", "start_line": 61, "start_column": 0, "end_line": 61, "end_column": 9 }, { "span": "import string", "start_line": 62, "start_column": 0, "end_line": 62, "end_column": 13 }, { "span": "import optparse", "start_line": 63, "start_column": 0, "end_line": 63, "end_column": 15 }, { "span": "import time", "start_line": 64, "start_column": 0, "end_line": 64, "end_column": 11 }, { "span": "import os", "start_line": 65, "start_column": 0, "end_line": 65, "end_column": 9 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "MR", "C", " ", "FG", "U", " ", "Computation", "al", " ", "Geno", "mic", "s", " ", "Group_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "$", "Id", "$", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Copy", "right", " ", "(", "C", ")", " ", "200", "9", " ", "Andre", "as", " ", "He", "ger_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Thi", "s", " ", "program", " ", "is", " ", "free", " ", "software", ";", " ", "you", " ", "can", " ", "redis", "tribut", "e", " ", "it", " ", "and", "/", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "modif", "y", " ", "it", " ", "under", " ", "the", " ", "term", "s", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "as", " ", "publi", "shed", " ", "by", " ", "the", " ", "Free", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", ";", " ", "eit", "her", " ", "version", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "of", " ", "the", " ", "License", ",", " ", "or", " ", "(", "at", " ", "your", " ", "option", ")", " ", "any", " ", "late", "r", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Thi", "s", " ", "program", " ", "is", " ", "distributed", " ", "in", " ", "the", " ", "hop", "e", " ", "tha", "t", " ", "it", " ", "will", " ", "be", " ", "usef", "ul", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "but", " ", "WITH", "OUT", " ", "ANY", " ", "WAR", "RAN", "TY", ";", " ", "with", "out", " ", "even", " ", "the", " ", "impli", "ed", " ", "warr", "ant", "y", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "or", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", ".", " ", " ", "See", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", " ", "for", " ", "more", " ", "deta", "il", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "You", " ", "shou", "ld", " ", "have", " ", "receive", "d", " ", "a", " ", "copy", " ", "of", " ", "the", " ", "GN", "U", " ", "General", " ", "Public", " ", "License", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "along", " ", "with", " ", "this", " ", "program", ";", " ", "if", " ", "not", ",", " ", "write", " ", "to", " ", "the", " ", "Free", " ", "Sof", "twa", "re_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "Foun", "dati", "on", ",", " ", "Inc", ".,", " ", "5", "9", " ", "Temp", "le", " ", "Place", " ", "-", " ", "Suit", "e", " ", "330", ",", " ", "Bo", "ston", ",", " ", "MA", " ", " ", "0211", "1", "-1", "307", ",", " ", "USA", "._", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "###########", "###########", "###########", "###########", "###", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "\\", "10", ";", "gff", "2w", "ig", "gle", "\\u", "stats", ".", "py", " ", "-", " ", "compute", " ", "covera", "ge", " ", "of", " ", "interval", "s", "\\", "10", ";", "==============", "==============", "==============", "=========", "\\", "10", ";", "\\", "10", ";", ":", "Author", ":", " ", "Andre", "as", " ", "He", "ger", "\\", "10", ";", ":", "Release", ":", " ", "$", "Id", "$", "\\", "10", ";", ":", "Date", ":", " ", "|", "toda", "y", "|", "\\", "10", ";", ":", "Ta", "gs", ":", " ", "Pyth", "on", "\\", "10", ";", "\\", "10", ";", "Pur", "pose", "\\", "10", ";", "-------", "\\", "10", ";", "\\", "10", ";", "Thi", "s", " ", "script", " ", "builds", " ", "a", " ", ":", "term", ":`", "wig", "gle", "`", " ", "file", " ", "from", " ", "a", " ", ":", "term", ":`", "gff", "`", " ", "format", "ted", "\\", "10", ";", "file", " ", "by", " ", "stack", "ing", " ", "the", " ", "interval", "s", " ", "in", " ", "the", " ", ":", "term", ":`", "gff", "`", " ", "format", "ted", " ", "file", " ", "on", "\\", "10", ";", "top", " ", "of", " ", "each", " ", "other", ".", " ", "The", " ", "value", " ", "in", " ", "the", " ", ":", "term", ":`", "wig", "gle", "`", " ", "file", " ", "is", " ", "the", " ", "height", "\\", "10", ";", "of", " ", "the", " ", "stack", ".", "\\", "10", ";", "\\", "10", ";", "Us", "age", "\\", "10", ";", "-----", "\\", "10", ";", "\\", "10", ";", "Exam", "ple", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", "python", " ", "gff", "2w", "ig", "gle", "\\u", "stats", ".", "py", " ", "--", "help", "\\", "10", ";", "\\", "10", ";", "Type", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", "python", " ", "gff", "2w", "ig", "gle", "\\u", "stats", ".", "py", " ", "--", "help", "\\", "10", ";", "\\", "10", ";", "for", " ", "command", " ", "line", " ", "help", ".", "\\", "10", ";", "\\", "10", ";", "Document", "ation", "\\", "10", ";", "-------------", "\\", "10", ";", "\\", "10", ";", "Code", "\\", "10", ";", "----", "\\", "10", ";", "\\", "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_", "import_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "optparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "glob_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "CGA", "T_", "._", "Experiment_", "as_", "E_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "Stats_", "as_", "Stats_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "CGA", "T_", "._", "GT", "F_", "as_", "GT", "F_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "CGA", "T_", "._", "Wi", "ggle", "_", "as_", "Wi", "ggle", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "align", "lib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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 ", " _", "parser_", "=_", "E_", "._", "Optio", "n", "Parser_", "(_", "version_", "=_", "\"%", "prog", " ", "version", ":", " ", "$", "Id", ":", " ", "gff", "2w", "ig", "gle", "\\u", "stats", ".", "py", " ", "278", "1", " ", "200", "9", "-0", "9", "-1", "0", " ", "11", ":", "3", "3", ":", "14", "Z", " ", "andr", "eas", " ", "$\"_", ",_", "usage_", "=_", "globals_", "(_", ")_", "[_", "\"\\u\\u", "doc", "\\u\\u\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "g", "\"_", ",_", "\"--", "geno", "me", "-", "file", "\"_", ",_", "dest_", "=_", "\"", "geno", "me", "\\u", "file", "\"_", ",_", "type_", "=_", "\"", "string", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "filename", " ", "with", " ", "geno", "me", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "wig", "gle", "-", "files", "\"_", ",_", "dest_", "=_", "\"", "wig", "gle", "\\u", "files", "\"_", ",_", "type_", "=_", "\"", "string", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "glob", " ", "express", "ion", " ", "for", " ", "wig", "gle", " ", "files", " ", "[", "%", "default", "].", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "prefix", "\"_", ",_", "dest_", "=_", "\"", "prefix", "\"_", ",_", "type_", "=_", "\"", "string", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "prefix", " ", "to", " ", "add", " ", "to", " ", "conti", "g", " ", "names", " ", "bef", "ore", " ", "look", "up", " ", "[", "%", "default", "].", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"-", "a", "\"_", ",_", "\"--", "as", "-", "gtf", "\"_", ",_", "dest_", "=_", "\"", "as", "\\u", "gtf", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "input", " ", "is", " ", "in", " ", "gtf", " ", "format", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "test", "\"_", ",_", "dest_", "=_", "\"", "test", "\"_", ",_", "type_", "=_", "\"", "int", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "test", " ", "-", " ", "stop", " ", "after", " ", "#", " ", "rows", " ", "of", " ", "pars", "ing", " ", "[", "%", "default", "].", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "add", "\\u", "option_", "(_", "\"--", "with", "-", "values", "\"_", ",_", "dest_", "=_", "\"", "with", "\\u", "values", "\"_", ",_", "action_", "=_", "\"", "store", "\\u", "true", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "help_", "=_", "\"", "output", " ", "values", " ", "in", " ", "last", " ", "column", " ", "[", "%", "default", "].", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "parser_", "._", "set\\u", "defaults_", "(_", "wig", "gle", "\\u", "files_", "=_", "\"*", ".", "data", ".", "bz2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "prefix_", "=_", "\"\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "with", "\\u", "values_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "test_", "=_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "options_", ",_", "args_", ")_", "=_", "E_", "._", "Start_", "(_", "parser_", ",_", "add", "\\u", "pipe", "\\u", "options_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "open", " ", "indexe", "d", " ", "access", " ", "to", " ", "wig", "gle", "s_", "\\u\\u\\uNL\\u\\u\\u_", "wig", "gle", "\\u", "files_", "=_", "glob_", "._", "glob_", "(_", "options_", "._", "wig", "gle", "\\u", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "wig", "gle", "\\u", "files_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "IO", "Error_", "(_", "\"", "coul", "d", " ", "not", " ", "find", " ", "wig", "gle", " ", "files", " ", "with", " ", "'%", "s", "'\"_", "%_", "options_", "._", "wig", "gle", "\\u", "files_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "index_", "=_", "Wi", "ggle", "_", "._", "Wi", "ggle", "Multi", "Indexe", "d", "Access_", "(_", "wig", "gle", "\\u", "files_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "keep", "\\u", "open_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "use", "\\u", "cache_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "as", "\\u", "gtf", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iterator_", "=_", "GT", "F_", "._", "flat", "\\u", "gene", "\\u", "iterator_", "(_", "GT", "F_", "._", "iterator_", "(_", "sys_", "._", "stdin_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "id_", "=_", "\"", "gene", "\\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 ", " _", "iterator_", "=_", "GT", "F_", "._", "chunk", "\\u", "iterator_", "(_", "GT", "F_", "._", "iterator_", "(_", "sys_", "._", "stdin_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "id_", "=_", "\"", "query", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nin", "put_", ",_", "noutput", "_", ",_", "ns", "kip", "ped_", "=_", "0_", ",_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "._", "stdout_", "._", "write_", "(_", "\"%", "s", "\\\\", "tn", "ali", "\\\\", "t", "%", "s", "\"_", "%_", "(_", "id_", ",_", "\"\\\\", "t", "\"_", "._", "join_", "(_", "Stats_", "._", "Distribut", "ional", "Parameters_", "(_", ")_", "._", "get", "Headers_", "(_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "with", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "stdout_", "._", "write_", "(_", "\"\\\\", "tval", "ues", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "._", "stdout_", "._", "write_", "(_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "gff", "s_", "in_", "iterator_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "options_", "._", "test_", "and_", "nin", "put_", ">=_", "options_", "._", "test_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nin", "put_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "loglevel_", ">=_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "gff", "_", "in_", "gff", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "std", "log_", "._", "write_", "(_", "str_", "(_", "gff", "_", ")_", "+_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "map", "\\u", "geno", "me", "2", "query_", "=_", "align", "lib_", "._", "make", "Align", "ment", "Blocks_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "gff", "_", "in_", "gff", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "map", "\\u", "geno", "me", "2", "query_", "._", "add", "Diag", "onal", "_", "(_", "gff", "_", "._", "start_", ",_", "gff", "_", "._", "end_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "index_", "._", "get_", "(_", "options_", "._", "prefix_", "+_", "gff", "_", "._", "contig_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "map", "\\u", "geno", "me", "2", "query_", "._", "get", "Row", "From_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "map", "\\u", "geno", "me", "2", "query_", "._", "get", "Row", "To_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "x_", ",_", "vv_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "v_", "in_", "vv_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "map", "\\u", "geno", "me", "2", "query_", "._", "map", "Row", "To", "Col_", "(_", "x_", ")_", ">=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "values_", "._", "append_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "x_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "values_", ")_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ns", "kip", "ped_", "+=_", "1_", "\\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_", "noutput", "_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "loglevel_", ">=_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "std", "log_", "._", "write_", "(_", "\"#", " ", "%", "s", "\\\\", "n", "\"_", "%_", "\",\"_", "._", "join_", "(_", "[_", "\"%", "5.3", "f", "\"_", "%_", "v_", "for_", "v_", "in_", "values_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "s_", "=_", "Stats_", "._", "Distribut", "ional", "Parameters_", "(_", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "options_", "._", "as", "\\u", "gtf", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "id_", "=_", "gff", "_", "._", "gene", "\\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 ", " _", "id_", "=_", "gff", "_", "._", "m", "Attributes_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "._", "stdout_", "._", "write_", "(_", "\"%", "s", "\\\\", "t", "%", "i", "\\\\", "t", "%", "s", "\"_", "%_", "(_", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "map", "\\u", "geno", "me", "2", "query_", "._", "get", "Num", "Aligned", "_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "s_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "options_", "._", "with", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "stdout_", "._", "write_", "(_", "\"\\\\", "t", "%", "s", "\"_", "%_", "\",\"_", "._", "join_", "(_", "[_", "\"%", "5.3", "f", "\"_", "%_", "v_", "for_", "v_", "in_", "values_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "._", "stdout_", "._", "write_", "(_", "\"\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "options_", "._", "loglevel_", ">=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "options_", "._", "std", "log_", "._", "write_", "(_", "\"#", " ", "nin", "put", "=", "%", "i", ",", " ", "noutput", "=", "%", "i", ",", " ", "ns", "kip", "ped", "=", "%", "i", "\\\\", "n", "\"_", "%_", "(_", "nin", "put_", ",_", "noutput", "_", ",_", "ns", "kip", "ped_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "E_", "._", "Stop_", "(_", ")_", "\\u\\u\\uDEDENT\\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, 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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 ]
Duplicate key in dict literal
ProgVal/Limnoria/src/ircutils.py
[ { "content": "###\n# Copyright (c) 2002-2005, Jeremiah Fincher\n# Copyright (c) 2009,2011,2015 James McCoy\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# * Redistributions of source code must retain the above copyright notice,\n# this list of conditions, and the following disclaimer.\n# * Redistributions in binary form must reproduce the above copyright notice,\n# this list of conditions, and the following disclaimer in the\n# documentation and/or other materials provided with the distribution.\n# * Neither the name of the author of this software nor the name of\n# contributors to this software may be used to endorse or promote products\n# derived from this software without specific prior written consent.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n# POSSIBILITY OF SUCH DAMAGE.\n###\n\n\"\"\"\nProvides a great number of useful utility functions for IRC. Things to muck\naround with hostmasks, set bold or color on strings, IRC-case-insensitive\ndicts, a nick class to handle nicks (so comparisons and hashing and whatnot\nwork in an IRC-case-insensitive fashion), and numerous other things.\n\"\"\"\n\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport re\nimport sys\nimport time\nimport base64\nimport random\nimport string\nimport textwrap\nimport functools\n\nfrom . import utils\nfrom .utils import minisix\nfrom .version import version\n\nfrom .i18n import PluginInternationalization\n_ = PluginInternationalization()\n\n\nuserHostmaskRe = re.compile(r'^\\S+!\\S+@\\S+$')\n\n\n\n\n\n\n\n_rfc1459trans = utils.str.MultipleReplacer(dict(list(zip(\n string.ascii_uppercase + r'\\[]~',\n string.ascii_lowercase + r'|{}^'))))\n\n\nnickEqual = strEqual\n\n_nickchars = r'[]\\`_^{|}'\nnickRe = re.compile(r'^[A-Za-z%s][-0-9A-Za-z%s]*$'\n % (re.escape(_nickchars), re.escape(_nickchars)))\n\n\n\n\n\n_patternCache = utils.structures.CacheDict(1000)\n\n_hostmaskPatternEqualCache = utils.structures.CacheDict(1000)\n\n\n_plusRequireArguments = 'ovhblkqeI'\n_minusRequireArguments = 'ovhbkqeI'\n\n\n\n\n\n\n# Definition of mircColors dictionary moved below because it became an IrcDict.\n\n\n\n\n_stripColorRe = re.compile(r'\\x03(?:\\d{1,2},\\d{1,2}|\\d{1,2}|,\\d{1,2}|)')\n\n\n\n\n_containsFormattingRe = re.compile(r'[\\x02\\x03\\x16\\x1f]')\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nmircColors = IrcDict({\n 'white': '0',\n 'black': '1',\n 'blue': '2',\n 'green': '3',\n 'red': '4',\n 'brown': '5',\n 'purple': '6',\n 'orange': '7',\n 'yellow': '8',\n 'light green': '9',\n 'teal': '10',\n 'light blue': '11',\n 'dark blue': '12',\n 'pink': '13',\n 'dark grey': '14',\n 'light grey': '15',\n 'dark gray': '14',\n 'light gray': '15',\n})\n\n# We'll map integers to their string form so mircColor is simpler.\nfor (k, v) in list(mircColors.items()):\n if k is not None: # Ignore empty string for None.\n sv = str(v)\n mircColors[sv] = sv\n mircColors[sv.zfill(2)] = sv\n\n\n\n\nAUTHENTICATE_CHUNK_SIZE = 400\n\n\n\nnumerics = {\n # <= 2.10\n # Reply\n '001': 'RPL_WELCOME',\n '002': 'RPL_YOURHOST',\n '003': 'RPL_CREATED',\n '004': 'RPL_MYINFO',\n '005': 'RPL_BOUNCE',\n '302': 'RPL_USERHOST',\n '303': 'RPL_ISON',\n '301': 'RPL_AWAY',\n '305': 'RPL_UNAWAY',\n '306': 'RPL_NOWAWAY',\n '311': 'RPL_WHOISUSER',\n '312': 'RPL_WHOISSERVER',\n '313': 'RPL_WHOISOPERATOR',\n '317': 'RPL_WHOISIDLE',\n '318': 'RPL_ENDOFWHOIS',\n '319': 'RPL_WHOISCHANNELS',\n '314': 'RPL_WHOWASUSER',\n '369': 'RPL_ENDOFWHOWAS',\n '321': 'RPL_LISTSTART',\n '322': 'RPL_LIST',\n '323': 'RPL_LISTEND',\n '325': 'RPL_UNIQOPIS',\n '324': 'RPL_CHANNELMODEIS',\n '331': 'RPL_NOTOPIC',\n '332': 'RPL_TOPIC',\n '341': 'RPL_INVITING',\n '342': 'RPL_SUMMONING',\n '346': 'RPL_INVITELIST',\n '347': 'RPL_ENDOFINVITELIST',\n '348': 'RPL_EXCEPTLIST',\n '349': 'RPL_ENDOFEXCEPTLIST',\n '351': 'RPL_VERSION',\n '352': 'RPL_WHOREPLY',\n '352': 'RPL_WHOREPLY',\n '353': 'RPL_NAMREPLY',\n '366': 'RPL_ENDOFNAMES',\n '364': 'RPL_LINKS',\n '365': 'RPL_ENDOFLINKS',\n '367': 'RPL_BANLIST',\n '368': 'RPL_ENDOFBANLIST',\n '371': 'RPL_INFO',\n '374': 'RPL_ENDOFINFO',\n '372': 'RPL_MOTD',\n '376': 'RPL_ENDOFMOTD',\n '381': 'RPL_YOUREOPER',\n '382': 'RPL_REHASHING',\n '383': 'RPL_YOURESERVICE',\n '391': 'RPL_TIME',\n '392': 'RPL_USERSSTART',\n '393': 'RPL_USERS',\n '394': 'RPL_ENDOFUSERS',\n '395': 'RPL_NOUSERS',\n '200': 'RPL_TRACELINK',\n '201': 'RPL_TRACECONNECTING',\n '202': 'RPL_TRACEHANDSHAKE',\n '203': 'RPL_TRACEUNKNOWN',\n '204': 'RPL_TRACEOPERATOR',\n '205': 'RPL_TRACEUSER',\n '206': 'RPL_TRACESERVER',\n '207': 'RPL_TRACESERVICE',\n '208': 'RPL_TRACENEWTYPE',\n '209': 'RPL_TRACECLASS',\n '210': 'RPL_TRACERECONNECT',\n '261': 'RPL_TRACELOG',\n '262': 'RPL_TRACEEND',\n '211': 'RPL_STATSLINKINFO',\n '212': 'RPL_STATSCOMMANDS',\n '219': 'RPL_ENDOFSTATS',\n '242': 'RPL_STATSUPTIME',\n '243': 'RPL_STATSOLINE',\n '221': 'RPL_UMODEIS',\n '234': 'RPL_SERVLIST',\n '235': 'RPL_SERVLISTEND',\n '251': 'RPL_LUSERCLIENT',\n '252': 'RPL_LUSEROP',\n '253': 'RPL_LUSERUNKNOWN',\n '254': 'RPL_LUSERCHANNELS',\n '255': 'RPL_LUSERME',\n '256': 'RPL_ADMINME',\n '257': 'RPL_ADMINLOC1',\n '258': 'RPL_ADMINLOC2',\n '259': 'RPL_ADMINEMAIL',\n '263': 'RPL_TRYAGAIN',\n\n # Error\n '401': 'ERR_NOSUCHNICK',\n '402': 'ERR_NOSUCHSERVER',\n '403': 'ERR_NOSUCHCHANNEL',\n '404': 'ERR_CANNOTSENDTOCHAN',\n '405': 'ERR_TOOMANYCHANNELS',\n '406': 'ERR_WASNOSUCHNICK',\n '407': 'ERR_TOOMANYTARGETS',\n '408': 'ERR_NOSUCHSERVICE',\n '409': 'ERR_NOORIGIN',\n '411': 'ERR_NORECIPIENT',\n '412': 'ERR_NOTEXTTOSEND',\n '413': 'ERR_NOTOPLEVEL',\n '414': 'ERR_WILDTOPLEVEL',\n '415': 'ERR_BADMASK',\n '421': 'ERR_UNKNOWNCOMMAND',\n '422': 'ERR_NOMOTD',\n '423': 'ERR_NOADMININFO',\n '424': 'ERR_FILEERROR',\n '431': 'ERR_NONICKNAMEGIVEN',\n '432': 'ERR_ERRONEUSNICKNAME',\n '433': 'ERR_NICKNAMEINUSE',\n '436': 'ERR_NICKCOLLISION',\n '437': 'ERR_UNAVAILRESOURCE',\n '441': 'ERR_USERNOTINCHANNEL',\n '442': 'ERR_NOTONCHANNEL',\n '443': 'ERR_USERONCHANNEL',\n '444': 'ERR_NOLOGIN',\n '445': 'ERR_SUMMONDISABLED',\n '446': 'ERR_USERSDISABLED',\n '451': 'ERR_NOTREGISTERED',\n '461': 'ERR_NEEDMOREPARAMS',\n '462': 'ERR_ALREADYREGISTRED',\n '463': 'ERR_NOPERMFORHOST',\n '464': 'ERR_PASSWDMISMATCH',\n '465': 'ERR_YOUREBANNEDCREEP',\n '466': 'ERR_YOUWILLBEBANNED',\n '467': 'ERR_KEYSET',\n '471': 'ERR_CHANNELISFULL',\n '472': 'ERR_UNKNOWNMODE',\n '473': 'ERR_INVITEONLYCHAN',\n '474': 'ERR_BANNEDFROMCHAN',\n '475': 'ERR_BADCHANNELKEY',\n '476': 'ERR_BADCHANMASK',\n '477': 'ERR_NOCHANMODES',\n '478': 'ERR_BANLISTFULL',\n '481': 'ERR_NOPRIVILEGES',\n '482': 'ERR_CHANOPRIVSNEEDED',\n '483': 'ERR_CANTKILLSERVER',\n '484': 'ERR_RESTRICTED',\n '485': 'ERR_UNIQOPPRIVSNEEDED',\n '491': 'ERR_NOOPERHOST',\n '501': 'ERR_UMODEUNKNOWNFLAG',\n '502': 'ERR_USERSDONTMATCH',\n\n # Reserved\n '231': 'RPL_SERVICEINFO',\n '232': 'RPL_ENDOFSERVICES',\n '233': 'RPL_SERVICE',\n '300': 'RPL_NONE',\n '316': 'RPL_WHOISCHANOP',\n '361': 'RPL_KILLDONE',\n '362': 'RPL_CLOSING',\n '363': 'RPL_CLOSEEND',\n '373': 'RPL_INFOSTART',\n '384': 'RPL_MYPORTIS',\n '213': 'RPL_STATSCLINE',\n '214': 'RPL_STATSNLINE',\n '215': 'RPL_STATSILINE',\n '216': 'RPL_STATSKLINE',\n '217': 'RPL_STATSQLINE',\n '218': 'RPL_STATSYLINE',\n '240': 'RPL_STATSVLINE',\n '241': 'RPL_STATSLLINE',\n '244': 'RPL_STATSHLINE',\n '244': 'RPL_STATSSLINE',\n '246': 'RPL_STATSPING',\n '247': 'RPL_STATSBLINE',\n '250': 'RPL_STATSDLINE',\n '492': 'ERR_NOSERVICEHOST',\n\n # IRC v3.1\n # SASL\n '900': 'RPL_LOGGEDIN',\n '901': 'RPL_LOGGEDOUT',\n '902': 'ERR_NICKLOCKED',\n '903': 'RPL_SASLSUCCESS',\n '904': 'ERR_SASLFAIL',\n '905': 'ERR_SASLTOOLONG',\n '906': 'ERR_SASLABORTED',\n '907': 'ERR_SASLALREADY',\n '908': 'RPL_SASLMECHS',\n\n # IRC v3.2\n # Metadata\n '760': 'RPL_WHOISKEYVALUE',\n '761': 'RPL_KEYVALUE',\n '762': 'RPL_METADATAEND',\n '764': 'ERR_METADATALIMIT',\n '765': 'ERR_TARGETINVALID',\n '766': 'ERR_NOMATCHINGKEY',\n '767': 'ERR_KEYINVALID',\n '768': 'ERR_KEYNOTSET',\n '769': 'ERR_KEYNOPERMISSION',\n\n # Monitor\n '730': 'RPL_MONONLINE',\n '731': 'RPL_MONOFFLINE',\n '732': 'RPL_MONLIST',\n '733': 'RPL_ENDOFMONLIST',\n '734': 'ERR_MONLISTFULL',\n}\n\nif __name__ == '__main__':\n import doctest\n doctest.testmod(sys.modules['__main__'])\n# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "'352':", "start_line": 939, "start_column": 8, "end_line": 939, "end_column": 13 }, { "span": "'244':", "start_line": 1065, "start_column": 8, "end_line": 1065, "end_column": 13 } ]
[ { "span": "'352':", "start_line": 940, "start_column": 8, "end_line": 940, "end_column": 13 }, { "span": "'244':", "start_line": 1066, "start_column": 8, "end_line": 1066, "end_column": 13 } ]
1
true
[ "[CLS]_", "Duplicate", "_", "key_", "in_", "dict_", "literal_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "2002", "-", "2005", ",", " ", "Jer", "emi", "ah", " ", "Fin", "cher", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Copy", "right", " ", "(", "c", ")", " ", "200", "9", ",", "2011", ",", "201", "5", " ", "Jam", "es", " ", "Mc", "Co", "y_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "rights", " ", "reserve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Redistributi", "on", " ", "and", " ", "use", " ", "in", " ", "source", " ", "and", " ", "binar", "y", " ", "forms", ",", " ", "with", " ", "or", " ", "with", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "modification", ",", " ", "are", " ", "permit", "ted", " ", "provided", " ", "tha", "t", " ", "the", " ", "follow", "ing", " ", "condition", "s", " ", "are", " ", "met", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above", " ", "copyr", "ight", " ", "notice", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "this", " ", "list", " ", "of", " ", "condition", "s", ",", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "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_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", " ", "and", "/", "or", " ", "other", " ", "material", "s", " ", "provided", " ", "with", " ", "the", " ", "distribu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "*", " ", "Nei", "ther", " ", "the", " ", "name", " ", "of", " ", "the", " ", "author", " ", "of", " ", "this", " ", "software", " ", "nor", " ", "the", " ", "name", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contributor", "s", " ", "to", " ", "this", " ", "software", " ", "may", " ", "be", " ", "used", " ", "to", " ", "endo", "rse", " ", "or", " ", "promote", " ", "products_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "derive", "d", " ", "from", " ", "this", " ", "software", " ", "with", "out", " ", "specific", " ", "prior", " ", "writt", "en", " ", "consent", "._", "\\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", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "AND", " ", "ANY", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ARE", " ", "DISC", "LAI", "MED", ".", " ", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "COPY", "RIG", "HT", " ", "OWNER", " ", "OR", " ", "CONTRIB", "UTO", "RS", " ", "BE_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "INC", "IDENT", "AL", ",", " ", "SPECIAL", ",", " ", "EXE", "MPL", "ARY", ",", " ", "OR_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CONS", "EQU", "ENTI", "AL", " ", "DA", "MAGE", "S", " ", "(", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "PROC", "URE", "MENT", " ", "OF_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SUBST", "ITU", "TE", " ", "GOOD", "S", " ", "OR", " ", "SERVICES", ";", " ", "LOSS", " ", "OF", " ", "USE", ",", " ", "DATA", ",", " ", "OR", " ", "PROF", "IT", "S", ";", " ", "OR", " ", "BUS", "INE", "SS_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", " ", "CAU", "SED", " ", "AND", " ", "ON", " ", "ANY", " ", "THE", "ORY", " ", "OF", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "CONTR", "ACT", ",", " ", "STRI", "CT", " ", "LI", "ABI", "LIT", "Y", ",", " ", "OR", " ", "TOR", "T", " ", "(", "INC", "LU", "DING", " ", "NEG", "LIG", "ENCE", " ", "OR", " ", "OTHER", "WI", "SE", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "ARI", "SIN", "G", " ", "IN", " ", "ANY", " ", "WAY", " ", "OUT", " ", "OF", " ", "THE", " ", "USE", " ", "OF", " ", "THIS", " ", "SOFT", "WARE", ",", " ", "EVE", "N", " ", "IF", " ", "ADV", "ISE", "D", " ", "OF", " ", "THE", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "POS", "SIB", "ILI", "TY", " ", "OF", " ", "SUC", "H", " ", "DA", "MAGE", "._", "\\u\\u\\uNL\\u\\u\\u_", "###", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Prov", "ides", " ", "a", " ", "great", " ", "number", " ", "of", " ", "usef", "ul", " ", "utility", " ", "function", "s", " ", "for", " ", "IR", "C", ".", " ", " ", "Thin", "gs", " ", "to", " ", "muc", "k", "\\", "10", ";", "aro", "und", " ", "with", " ", "host", "mask", "s", ",", " ", "set", " ", "bold", " ", "or", " ", "color", " ", "on", " ", "string", "s", ",", " ", "IR", "C", "-", "case", "-", "inse", "nsitive", "\\", "10", ";", "dict", "s", ",", " ", "a", " ", "nick", " ", "class", " ", "to", " ", "handle", " ", "nicks", " ", "(", "so", " ", "comparisons", " ", "and", " ", "hashin", "g", " ", "and", " ", "what", "not", "\\", "10", ";", "work", " ", "in", " ", "an", " ", "IR", "C", "-", "case", "-", "inse", "nsitive", " ", "fas", "hio", "n", "),", " ", "and", " ", "numero", "us", " ", "other", " ", "thing", "s", ".", "\\", "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_", "from_", "\\u\\u", "future\\u\\u_", "import_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "textwrap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "functools_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "import_", "utils_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "utils_", "import_", "mini", "six_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "version_", "import_", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "._", "i18n_", "import_", "Plug", "in", "Intern", "ation", "ali", "zation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u_", "=_", "Plug", "in", "Intern", "ation", "ali", "zation_", "(_", ")_", "\\u\\u\\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_", "user", "Host", "mask", "Re_", "=_", "re_", "._", "compile_", "(_", "r", "'", "^", "\\\\", "S", "+", "!\\\\", "S", "+", "@", "\\\\", "S", "+$", "'_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "\\u", "rfc", "145", "9", "trans_", "=_", "utils_", "._", "str_", "._", "Multipl", "e", "Replace", "r_", "(_", "dict_", "(_", "list_", "(_", "zip_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "string_", "._", "ascii", "\\u", "uppercase_", "+_", "r", "'\\\\[", "]", "~'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "string_", "._", "ascii", "\\u", "lowercase_", "+_", "r", "'|", "{}", "^", "'_", ")_", ")_", ")_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "nick", "Equal_", "=_", "str", "Equal_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u", "nick", "chars_", "=_", "r", "'[", "]\\\\", "`\\u", "^", "{", "|", "}'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nick", "Re_", "=_", "re_", "._", "compile_", "(_", "r", "'", "^", "[", "A", "-", "Za", "-", "z", "%", "s", "][", "-0", "-", "9", "A", "-", "Za", "-", "z", "%", "s", "]*", "$'_", "\\u\\u\\uNL\\u\\u\\u_", "%_", "(_", "re_", "._", "escape_", "(_", "\\u", "nick", "chars_", ")_", ",_", "re_", "._", "escape_", "(_", "\\u", "nick", "chars_", ")_", ")_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "\\u", "pattern", "Cache_", "=_", "utils_", "._", "structures_", "._", "Cache", "Dict_", "(_", "1000_", ")_", "\\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_", "\\u", "host", "mask", "Pat", "tern", "Equal", "Cache_", "=_", "utils_", "._", "structures_", "._", "Cache", "Dict_", "(_", "1000_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "plus", "Requ", "ire", "Arguments_", "=_", "'", "ovh", "blk", "qe", "I", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "minu", "s", "Requ", "ire", "Arguments_", "=_", "'", "ovh", "bk", "qe", "I", "'_", "\\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_", "#", " ", "Definit", "ion", " ", "of", " ", "mir", "c", "Color", "s", " ", "dictionar", "y", " ", "moved", " ", "belo", "w", " ", "bec", "aus", "e", " ", "it", " ", "bec", "ame", " ", "an", " ", "Ir", "c", "Dict", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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", "strip", "Color", "Re_", "=_", "re_", "._", "compile_", "(_", "r", "'\\\\", "x0", "3", "(?:\\\\", "d", "{", "1", ",", "2", "},", "\\\\", "d", "{", "1", ",", "2", "}|", "\\\\", "d", "{", "1", ",", "2", "}|", ",\\\\", "d", "{", "1", ",", "2", "}|", ")'_", ")_", "\\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\\uDEDENT\\u\\u\\u_", "\\u", "contain", "s", "Formatt", "ing", "Re_", "=_", "re_", "._", "compile_", "(_", "r", "'[", "\\\\", "x0", "2", "\\\\", "x0", "3", "\\\\", "x1", "6", "\\\\", "x1", "f", "]'_", ")_", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "mir", "c", "Colors_", "=_", "Ir", "c", "Dict_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "white", "'_", ":_", "'", "0", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "black", "'_", ":_", "'", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "blue", "'_", ":_", "'", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "green", "'_", ":_", "'", "3", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "red", "'_", ":_", "'", "4", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "brow", "n", "'_", ":_", "'", "5", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pur", "ple", "'_", ":_", "'", "6", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "orange", "'_", ":_", "'", "7", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "yell", "ow", "'_", ":_", "'", "8", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", " ", "green", "'_", ":_", "'", "9", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tea", "l", "'_", ":_", "'", "10", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", " ", "blue", "'_", ":_", "'", "11", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", " ", "blue", "'_", ":_", "'", "1", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "pin", "k", "'_", ":_", "'", "13", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", " ", "grey", "'_", ":_", "'", "14", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", " ", "grey", "'_", ":_", "'", "15", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dark", " ", "gray", "'_", ":_", "'", "14", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "light", " ", "gray", "'_", ":_", "'", "15", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", "'", "ll", " ", "map", " ", "integ", "ers", " ", "to", " ", "thei", "r", " ", "string", " ", "form", " ", "so", " ", "mir", "c", "Color", " ", "is", " ", "simple", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "(_", "k_", ",_", "v_", ")_", "in_", "list_", "(_", "mir", "c", "Colors_", "._", "items_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "k_", "is_", "not_", "None_", ":_", "#", " ", "Ignor", "e", " ", "empty", " ", "string", " ", "for", " ", "Non", "e", "._", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sv_", "=_", "str_", "(_", "v_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mir", "c", "Colors_", "[_", "sv_", "]_", "=_", "sv_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mir", "c", "Colors_", "[_", "sv_", "._", "zfill_", "(_", "2_", ")_", "]_", "=_", "sv_", "\\u\\u\\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\\uDEDENT\\u\\u\\u_", "AUTH", "ENTI", "CATE", "\\u", "CHUNK", "\\u", "SIZE_", "=_", "400_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "numeri", "cs_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "<=", " ", "2.1", "0_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Reply_", "\\u\\u\\uNL\\u\\u\\u_", "'", "001", "'_", ":_", "'", "RPL", "\\u", "WEL", "COM", "E", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "002", "'_", ":_", "'", "RPL", "\\u", "YOU", "RH", "OST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "003", "'_", ":_", "'", "RPL", "\\u", "CREATE", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "004", "'_", ":_", "'", "RPL", "\\u", "MY", "INFO", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "005", "'_", ":_", "'", "RPL", "\\u", "BO", "UNC", "E", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "302", "'_", ":_", "'", "RPL", "\\u", "USER", "HOST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "303", "'_", ":_", "'", "RPL", "\\u", "ISO", "N", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "301", "'_", ":_", "'", "RPL", "\\u", "AWA", "Y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "305", "'_", ":_", "'", "RPL", "\\u", "UNA", "WAY", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "306", "'_", ":_", "'", "RPL", "\\u", "NOW", "AWA", "Y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "311", "'_", ":_", "'", "RPL", "\\u", "WH", "OI", "SUS", "ER", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "312", "'_", ":_", "'", "RPL", "\\u", "WH", "OI", "SSE", "RV", "ER", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "313", "'_", ":_", "'", "RPL", "\\u", "WH", "OI", "SOP", "ERA", "TOR", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "317", "'_", ":_", "'", "RPL", "\\u", "WH", "OI", "SID", "LE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "318", "'_", ":_", "'", "RPL", "\\u", "END", "OF", "WH", "OI", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "319", "'_", ":_", "'", "RPL", "\\u", "WH", "OI", "SCH", "ANN", "ELS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "314", "'_", ":_", "'", "RPL", "\\u", "WH", "OW", "AS", "USER", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "369", "'_", ":_", "'", "RPL", "\\u", "END", "OF", "WH", "OW", "AS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "321", "'_", ":_", "'", "RPL", "\\u", "LIST", "START", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "322", "'_", ":_", "'", "RPL", "\\u", "LIST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "323", "'_", ":_", "'", "RPL", "\\u", "LISTEN", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "325", "'_", ":_", "'", "RPL", "\\u", "UNI", "QO", "PI", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "324", "'_", ":_", "'", "RPL", "\\u", "CHAN", "NEL", "MODE", "IS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "331", "'_", ":_", "'", "RPL", "\\u", "NOT", "OP", "IC", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "332", "'_", ":_", "'", "RPL", "\\u", "TOPIC", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "341", "'_", ":_", "'", "RPL", "\\u", "INVI", "TIN", "G", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "342", "'_", ":_", "'", "RPL", "\\u", "SUM", "MON", "ING", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "346", "'_", ":_", "'", "RPL", "\\u", "INVI", "TEL", "IST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "347", "'_", ":_", "'", "RPL", "\\u", "END", "OF", "INVI", "TEL", "IST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "348", "'_", ":_", "'", "RPL", "\\u", "EXCE", "PT", "LIST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "349", "'_", ":_", "'", "RPL", "\\u", "END", "OF", "EXCE", "PT", "LIST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "351", "'_", ":_", "'", "RPL", "\\u", "VERSI", "ON", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "352", "'_", ":_", "'", "RPL", "\\u", "WH", "ORE", "PL", "Y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "352", "'_", ":_", "'", "RPL", "\\u", "WH", "ORE", "PL", "Y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "353", "'_", ":_", "'", "RPL", "\\u", "NAM", "REPLY", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "366", "'_", ":_", "'", "RPL", "\\u", "END", "OF", "NAMES", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "364", "'_", ":_", "'", "RPL", "\\u", "LINKS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "365", "'_", ":_", "'", "RPL", "\\u", "END", "OF", "LINKS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "367", "'_", ":_", "'", "RPL", "\\u", "BAN", "LIST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "368", "'_", ":_", "'", "RPL", "\\u", "END", "OF", "BAN", "LIST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "371", "'_", ":_", "'", "RPL", "\\u", "INFO", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "374", "'_", ":_", "'", "RPL", "\\u", "END", "OF", "INFO", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "372", "'_", ":_", "'", "RPL", "\\u", "MOT", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "376", "'_", ":_", "'", "RPL", "\\u", "END", "OF", "MOT", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "381", "'_", ":_", "'", "RPL", "\\u", "YOU", "RE", "OPER", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "382", "'_", ":_", "'", "RPL", "\\u", "RE", "HAS", "HING", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "383", "'_", ":_", "'", "RPL", "\\u", "YOU", "RESE", "RV", "ICE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "391", "'_", ":_", "'", "RPL", "\\u", "TIME", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "392", "'_", ":_", "'", "RPL", "\\u", "USERS", "START", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "393", "'_", ":_", "'", "RPL", "\\u", "USERS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "394", "'_", ":_", "'", "RPL", "\\u", "END", "OF", "USERS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "395", "'_", ":_", "'", "RPL", "\\u", "NO", "USERS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "200", "'_", ":_", "'", "RPL", "\\u", "TRACE", "LINK", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "201", "'_", ":_", "'", "RPL", "\\u", "TRACE", "CONNECT", "ING", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "202", "'_", ":_", "'", "RPL", "\\u", "TRACE", "HAND", "SHA", "KE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "203", "'_", ":_", "'", "RPL", "\\u", "TRACE", "UNK", "NOW", "N", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "204", "'_", ":_", "'", "RPL", "\\u", "TRACE", "OPERATOR", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "205", "'_", ":_", "'", "RPL", "\\u", "TRACE", "USER", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "206", "'_", ":_", "'", "RPL", "\\u", "TRACE", "SERVER", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "207", "'_", ":_", "'", "RPL", "\\u", "TRACE", "SERV", "ICE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "208", "'_", ":_", "'", "RPL", "\\u", "TRACE", "NEW", "TYPE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "209", "'_", ":_", "'", "RPL", "\\u", "TRACE", "CLASS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "210", "'_", ":_", "'", "RPL", "\\u", "TRACE", "RECO", "NN", "ECT", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "261", "'_", ":_", "'", "RPL", "\\u", "TRACE", "LOG", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "262", "'_", ":_", "'", "RPL", "\\u", "TRACE", "END", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "211", "'_", ":_", "'", "RPL", "\\u", "STATS", "LINK", "INFO", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "212", "'_", ":_", "'", "RPL", "\\u", "STATS", "COMMA", "NDS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "219", "'_", ":_", "'", "RPL", "\\u", "END", "OF", "STATS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "242", "'_", ":_", "'", "RPL", "\\u", "STATS", "UP", "TIME", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "243", "'_", ":_", "'", "RPL", "\\u", "STATS", "OL", "INE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "221", "'_", ":_", "'", "RPL", "\\u", "UM", "ODE", "IS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "234", "'_", ":_", "'", "RPL", "\\u", "SERV", "LIST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "235", "'_", ":_", "'", "RPL", "\\u", "SERV", "LISTEN", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "251", "'_", ":_", "'", "RPL", "\\u", "LUS", "ER", "CLIENT", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "252", "'_", ":_", "'", "RPL", "\\u", "LUS", "ERO", "P", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "253", "'_", ":_", "'", "RPL", "\\u", "LUS", "ER", "UNK", "NOW", "N", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "254", "'_", ":_", "'", "RPL", "\\u", "LUS", "ER", "CHANNELS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "255", "'_", ":_", "'", "RPL", "\\u", "LUS", "ERM", "E", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "256", "'_", ":_", "'", "RPL", "\\u", "ADM", "IN", "ME", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "257", "'_", ":_", "'", "RPL", "\\u", "ADM", "IN", "LOC", "1", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "258", "'_", ":_", "'", "RPL", "\\u", "ADM", "IN", "LOC", "2", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "259", "'_", ":_", "'", "RPL", "\\u", "ADM", "INE", "MAIL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "263", "'_", ":_", "'", "RPL", "\\u", "TR", "YA", "GAIN", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Error_", "\\u\\u\\uNL\\u\\u\\u_", "'", "401", "'_", ":_", "'", "ERR", "\\u", "NOS", "UC", "HN", "IC", "K", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "402", "'_", ":_", "'", "ERR", "\\u", "NOS", "UC", "HS", "ERVE", "R", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "403", "'_", ":_", "'", "ERR", "\\u", "NOS", "UC", "HC", "HAN", "NEL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "404", "'_", ":_", "'", "ERR", "\\u", "CANNO", "TS", "END", "TOC", "HAN", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "405", "'_", ":_", "'", "ERR", "\\u", "TOO", "MAN", "YC", "HAN", "NEL", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "406", "'_", ":_", "'", "ERR", "\\u", "WA", "SN", "OS", "UC", "HN", "IC", "K", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "407", "'_", ":_", "'", "ERR", "\\u", "TOO", "MAN", "YT", "ARG", "ET", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "408", "'_", ":_", "'", "ERR", "\\u", "NOS", "UC", "HS", "ERV", "ICE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "409", "'_", ":_", "'", "ERR", "\\u", "NOO", "RIG", "IN", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "411", "'_", ":_", "'", "ERR", "\\u", "NOR", "EC", "IP", "IENT", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "412", "'_", ":_", "'", "ERR", "\\u", "NOTE", "XT", "TOS", "END", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "413", "'_", ":_", "'", "ERR", "\\u", "NOT", "OP", "LE", "VEL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "414", "'_", ":_", "'", "ERR", "\\u", "WIL", "DT", "OP", "LE", "VEL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "415", "'_", ":_", "'", "ERR", "\\u", "BAD", "MASK", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "421", "'_", ":_", "'", "ERR", "\\u", "UNK", "NOW", "NC", "OM", "MAN", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "422", "'_", ":_", "'", "ERR", "\\u", "NOM", "OT", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "423", "'_", ":_", "'", "ERR", "\\u", "NO", "ADM", "INI", "NF", "O", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "424", "'_", ":_", "'", "ERR", "\\u", "FILE", "ERROR", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "431", "'_", ":_", "'", "ERR", "\\u", "NON", "IC", "KN", "AME", "GI", "VEN", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "432", "'_", ":_", "'", "ERR", "\\u", "ERR", "ONE", "US", "NIC", "KN", "AME", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "433", "'_", ":_", "'", "ERR", "\\u", "NIC", "KN", "AME", "IN", "USE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "436", "'_", ":_", "'", "ERR", "\\u", "NIC", "KC", "OL", "LIS", "ION", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "437", "'_", ":_", "'", "ERR", "\\u", "UNA", "VA", "IL", "RES", "OUR", "CE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "441", "'_", ":_", "'", "ERR", "\\u", "USER", "NOT", "INC", "HAN", "NEL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "442", "'_", ":_", "'", "ERR", "\\u", "NOT", "ON", "CHAN", "NEL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "443", "'_", ":_", "'", "ERR", "\\u", "USER", "ON", "CHAN", "NEL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "444", "'_", ":_", "'", "ERR", "\\u", "NO", "LOGIN", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "445", "'_", ":_", "'", "ERR", "\\u", "SUM", "MON", "DISABLED", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "446", "'_", ":_", "'", "ERR", "\\u", "USERS", "DISABLED", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "451", "'_", ":_", "'", "ERR", "\\u", "NOT", "REGISTER", "ED", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "461", "'_", ":_", "'", "ERR", "\\u", "NEED", "MOR", "EPA", "RAM", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "462", "'_", ":_", "'", "ERR", "\\u", "ALREADY", "REGI", "STRE", "D", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "463", "'_", ":_", "'", "ERR", "\\u", "NOP", "ERM", "FOR", "HOST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "464", "'_", ":_", "'", "ERR", "\\u", "PASS", "WD", "MIS", "MATCH", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "465", "'_", ":_", "'", "ERR", "\\u", "YOU", "REB", "ANN", "ED", "CRE", "EP", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "466", "'_", ":_", "'", "ERR", "\\u", "YOU", "WIL", "LB", "EBA", "NN", "ED", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "467", "'_", ":_", "'", "ERR", "\\u", "KEYS", "ET", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "471", "'_", ":_", "'", "ERR", "\\u", "CHAN", "NEL", "IS", "FULL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "472", "'_", ":_", "'", "ERR", "\\u", "UNK", "NOW", "NM", "ODE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "473", "'_", ":_", "'", "ERR", "\\u", "INVI", "TE", "ONL", "YC", "HAN", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "474", "'_", ":_", "'", "ERR", "\\u", "BAN", "NED", "FROM", "CHAN", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "475", "'_", ":_", "'", "ERR", "\\u", "BAD", "CHAN", "NEL", "KEY", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "476", "'_", ":_", "'", "ERR", "\\u", "BAD", "CHAN", "MASK", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "477", "'_", ":_", "'", "ERR", "\\u", "NOC", "HAN", "MODE", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "478", "'_", ":_", "'", "ERR", "\\u", "BAN", "LIST", "FULL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "481", "'_", ":_", "'", "ERR", "\\u", "NOP", "RI", "VI", "LE", "GE", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "482", "'_", ":_", "'", "ERR", "\\u", "CHAN", "OP", "RI", "VS", "NEED", "ED", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "483", "'_", ":_", "'", "ERR", "\\u", "CAN", "TK", "ILL", "SERVER", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "484", "'_", ":_", "'", "ERR", "\\u", "RESTR", "ICT", "ED", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "485", "'_", ":_", "'", "ERR", "\\u", "UNI", "QO", "PP", "RI", "VS", "NEED", "ED", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "491", "'_", ":_", "'", "ERR", "\\u", "NOO", "PER", "HOST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "501", "'_", ":_", "'", "ERR", "\\u", "UM", "ODE", "UNK", "NOW", "NF", "LA", "G", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "502", "'_", ":_", "'", "ERR", "\\u", "USERS", "DON", "TM", "ATCH", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Reserve", "d_", "\\u\\u\\uNL\\u\\u\\u_", "'", "231", "'_", ":_", "'", "RPL", "\\u", "SERV", "ICE", "INFO", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "232", "'_", ":_", "'", "RPL", "\\u", "END", "OF", "SERVICES", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "233", "'_", ":_", "'", "RPL", "\\u", "SERV", "ICE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "300", "'_", ":_", "'", "RPL", "\\u", "NON", "E", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "316", "'_", ":_", "'", "RPL", "\\u", "WH", "OI", "SCH", "ANO", "P", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "361", "'_", ":_", "'", "RPL", "\\u", "KILL", "DON", "E", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "362", "'_", ":_", "'", "RPL", "\\u", "CLO", "SIN", "G", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "363", "'_", ":_", "'", "RPL", "\\u", "CLOSE", "END", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "373", "'_", ":_", "'", "RPL", "\\u", "INFO", "START", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "384", "'_", ":_", "'", "RPL", "\\u", "MY", "PORT", "IS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "213", "'_", ":_", "'", "RPL", "\\u", "STATS", "CLI", "NE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "214", "'_", ":_", "'", "RPL", "\\u", "STATS", "NL", "INE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "215", "'_", ":_", "'", "RPL", "\\u", "STATS", "ILI", "NE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "216", "'_", ":_", "'", "RPL", "\\u", "STATS", "KL", "INE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "217", "'_", ":_", "'", "RPL", "\\u", "STATS", "QL", "INE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "218", "'_", ":_", "'", "RPL", "\\u", "STATS", "YL", "INE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "240", "'_", ":_", "'", "RPL", "\\u", "STATS", "VL", "INE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "241", "'_", ":_", "'", "RPL", "\\u", "STATS", "LL", "INE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "244", "'_", ":_", "'", "RPL", "\\u", "STATS", "HL", "INE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "244", "'_", ":_", "'", "RPL", "\\u", "STATS", "SLI", "NE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "246", "'_", ":_", "'", "RPL", "\\u", "STATS", "PING", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "247", "'_", ":_", "'", "RPL", "\\u", "STATS", "BLI", "NE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "250", "'_", ":_", "'", "RPL", "\\u", "STATS", "DL", "INE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "492", "'_", ":_", "'", "ERR", "\\u", "NOS", "ERV", "ICE", "HOST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IR", "C", " ", "v", "3.1", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SAS", "L_", "\\u\\u\\uNL\\u\\u\\u_", "'", "900", "'_", ":_", "'", "RPL", "\\u", "LOGGE", "DI", "N", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "901", "'_", ":_", "'", "RPL", "\\u", "LOGGE", "DO", "UT", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "902", "'_", ":_", "'", "ERR", "\\u", "NIC", "KL", "OCK", "ED", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "903", "'_", ":_", "'", "RPL", "\\u", "SAS", "LS", "UC", "CES", "S", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "904", "'_", ":_", "'", "ERR", "\\u", "SAS", "LF", "AI", "L", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "905", "'_", ":_", "'", "ERR", "\\u", "SAS", "LT", "OO", "LONG", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "906", "'_", ":_", "'", "ERR", "\\u", "SAS", "LAB", "ORT", "ED", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "907", "'_", ":_", "'", "ERR", "\\u", "SAS", "LA", "LR", "EAD", "Y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "908", "'_", ":_", "'", "RPL", "\\u", "SAS", "LM", "EC", "HS", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "IR", "C", " ", "v", "3.2", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Metadata_", "\\u\\u\\uNL\\u\\u\\u_", "'", "760", "'_", ":_", "'", "RPL", "\\u", "WH", "OI", "SK", "EY", "VALU", "E", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "761", "'_", ":_", "'", "RPL", "\\u", "KEY", "VALU", "E", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "762", "'_", ":_", "'", "RPL", "\\u", "METAD", "ATA", "END", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "764", "'_", ":_", "'", "ERR", "\\u", "METAD", "ATA", "LIMIT", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "765", "'_", ":_", "'", "ERR", "\\u", "TARGET", "INVALID", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "766", "'_", ":_", "'", "ERR", "\\u", "NOM", "ATCH", "ING", "KEY", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "767", "'_", ":_", "'", "ERR", "\\u", "KEY", "INVALID", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "768", "'_", ":_", "'", "ERR", "\\u", "KEY", "NOT", "SET", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "769", "'_", ":_", "'", "ERR", "\\u", "KEY", "NOP", "ERM", "ISS", "ION", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Monitor_", "\\u\\u\\uNL\\u\\u\\u_", "'", "730", "'_", ":_", "'", "RPL", "\\u", "MON", "ONL", "INE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "731", "'_", ":_", "'", "RPL", "\\u", "MON", "OFF", "LINE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "732", "'_", ":_", "'", "RPL", "\\u", "MON", "LIST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "733", "'_", ":_", "'", "RPL", "\\u", "END", "OF", "MON", "LIST", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "734", "'_", ":_", "'", "ERR", "\\u", "MON", "LIST", "FULL", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "doctest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doctest_", "._", "testmod_", "(_", "sys_", "._", "modules_", "[_", "'\\u", "\\u", "main", "\\u\\u'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "vim", ":", "set", " ", "shift", "widt", "h", "=", "4", " ", "soft", "tabs", "top", "=", "4", " ", "expand", "tab", " ", "text", "widt", "h", "=", "7", "9", ":_", "\\u\\u\\uNL\\u\\u\\u_", "\\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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Module is imported more than once
pytest-dev/pytest/_pytest/pytester.py
[ { "content": "\"\"\" (disabled by default) support for testing pytest and pytest plugins. \"\"\"\nimport codecs\nimport gc\nimport os\nimport platform\nimport re\nimport subprocess\nimport sys\nimport time\nimport traceback\nfrom fnmatch import fnmatch\n\nfrom py.builtin import print_\n\nfrom _pytest._code import Source\nimport py\nimport pytest\nfrom _pytest.main import Session, EXIT_OK\n\n\n\n\n\n\n\n\n# XXX copied from execnet's conftest.py - needs to be merged\nwinpymap = {\n 'python2.7': r'C:\\Python27\\python.exe',\n 'python2.6': r'C:\\Python26\\python.exe',\n 'python3.1': r'C:\\Python31\\python.exe',\n 'python3.2': r'C:\\Python32\\python.exe',\n 'python3.3': r'C:\\Python33\\python.exe',\n 'python3.4': r'C:\\Python34\\python.exe',\n 'python3.5': r'C:\\Python35\\python.exe',\n}\n\n\n\n# used at least by pytest-xdist plugin\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nrex_outcome = re.compile(\"(\\d+) ([\\w-]+)\")\n\n\n\n\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def getexecutable(name, cache={}):\n try:\n return cache[name]\n except KeyError:\n executable = py.path.local.sysfind(name)\n if executable:\n if name == \"jython\":\n import subprocess\n popen = subprocess.Popen([str(executable), \"--version\"],\n universal_newlines=True, stderr=subprocess.PIPE)\n out, err = popen.communicate()\n if not err or \"2.5\" not in err:\n executable = None\n if \"2.5.2\" in err:\n executable = None # http://bugs.jython.org/issue1790\n cache[name] = executable\n return executable", "metadata": "root.getexecutable", "header": "['module', '___EOS___']", "index": 119 } ]
[ { "span": "import subprocess", "start_line": 126, "start_column": 16, "end_line": 126, "end_column": 33 } ]
[ { "span": "import subprocess", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 17 } ]
1
true
[ "[CLS]_", "Module_", "is_", "imported_", "more_", "than_", "once_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", " ", "(", "disable", "d", " ", "by", " ", "default", ")", " ", "support", " ", "for", " ", "testi", "ng", " ", "pytest", " ", "and", " ", "pytest", " ", "plugin", "s", ".", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "codecs_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "gc_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "platform_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "re_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "fnmatch_", "import_", "fnmatch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "py_", "._", "builtin_", "import_", "print\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "\\u", "pytest_", "._", "\\u", "code_", "import_", "Source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "py_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pytest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u", "pytest_", "._", "main_", "import_", "Session_", ",_", "EXIT", "\\u", "OK_", "\\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_", "#", " ", "XX", "X", " ", "copie", "d", " ", "from", " ", "exec", "net", "'", "s", " ", "conftest", ".", "py", " ", "-", " ", "need", "s", " ", "to", " ", "be", " ", "merged_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "win", "pyma", "p_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "python", "2.7", "'_", ":_", "r", "'", "C", ":\\\\", "Pyth", "on2", "7", "\\\\", "python", ".", "exe", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "python", "2.6", "'_", ":_", "r", "'", "C", ":\\\\", "Pyth", "on2", "6", "\\\\", "python", ".", "exe", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "python", "3.1", "'_", ":_", "r", "'", "C", ":\\\\", "Pyth", "on", "3", "1", "\\\\", "python", ".", "exe", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "python", "3.2", "'_", ":_", "r", "'", "C", ":\\\\", "Pyth", "on", "32", "\\\\", "python", ".", "exe", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "python", "3.3", "'_", ":_", "r", "'", "C", ":\\\\", "Pyth", "on", "3", "3", "\\\\", "python", ".", "exe", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "python", "3.4", "'_", ":_", "r", "'", "C", ":\\\\", "Pyth", "on", "3", "4", "\\\\", "python", ".", "exe", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "python", "3.5", "'_", ":_", "r", "'", "C", ":\\\\", "Pyth", "on", "3", "5", "\\\\", "python", ".", "exe", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "used", " ", "at", " ", "leas", "t", " ", "by", " ", "pytest", "-", "xdi", "st", " ", "plugin_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "rex", "\\u", "outcome_", "=_", "re_", "._", "compile_", "(_", "\"(", "\\\\", "d", "+)", " ", "([\\\\", "w", "-]+)", "\"_", ")_", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\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_", "\\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_", "gete", "xec", "uta", "ble_", "(_", "name_", ",_", "cache_", "=_", "{_", "}_", ")_", ":_", "\\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_", "cache_", "[_", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "executable_", "=_", "py_", "._", "path_", "._", "local_", "._", "sys", "find_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "executable_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "name_", "==_", "\"", "jy", "tho", "n", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "subprocess_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "popen_", "=_", "subprocess_", "._", "Popen_", "(_", "[_", "str_", "(_", "executable_", ")_", ",_", "\"--", "version", "\"_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "universal", "\\u", "newlines_", "=_", "True_", ",_", "stderr_", "=_", "subprocess_", "._", "PIPE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out_", ",_", "err_", "=_", "popen_", "._", "communicate_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "err_", "or_", "\"", "2.5", "\"_", "not_", "in_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "executable_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"", "2.5", ".2", "\"_", "in_", "err_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "executable_", "=_", "None_", "#", " ", "http", "://", "bug", "s", ".", "jy", "tho", "n", ".", "org", "/", "issue", "179", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cache_", "[_", "name_", "]_", "=_", "executable_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "executable_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 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, 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 ]
Unused local variable
espeed/lightbulb/lightbulb/changelog.py
[ { "content": " def _get_diff(self):\n # git diff is NOT sorted by modified time\n #command = \"git diff --cached --name-only\"\n git_dir = self.path.get_git_dir()\n working_dir = self.path.get_working_dir()\n command = \"git diff --cached --name-status\"\n return self._execute(command)", "metadata": "root.ChangeLog._get_diff", "header": "['class', 'ChangeLog', '(', 'PickleDB', ')', ':', '___EOS___']", "index": 70 } ]
[ { "span": "git_dir ", "start_line": 73, "start_column": 8, "end_line": 73, "end_column": 15 }, { "span": "working_dir ", "start_line": 74, "start_column": 8, "end_line": 74, "end_column": 19 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Change", "Log_", "(_", "Pickl", "e", "DB_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "get", "\\u", "diff_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "git", " ", "diff", " ", "is", " ", "NOT", " ", "sorte", "d", " ", "by", " ", "modifi", "ed", " ", "time_", "\\u\\u\\uNL\\u\\u\\u_", "#", "command", " ", "=", " ", "\"", "git", " ", "diff", " ", "--", "cache", "d", " ", "--", "name", "-", "only", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "git", "\\u", "dir_", "=_", "self_", "._", "path_", "._", "get", "\\u", "git", "\\u", "dir_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "working", "\\u", "dir_", "=_", "self_", "._", "path_", "._", "get", "\\u", "working", "\\u", "dir_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "command_", "=_", "\"", "git", " ", " ", "diff", " ", "--", "cache", "d", " ", "--", "name", "-", "status", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "execute_", "(_", "command_", ")_", "\\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, 0, 1, 1, 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 ]
Except block handles 'BaseException'
jolynch/mit-tab/mittab/libs/data_import/import_rooms.py
[ { "content": "def import_rooms(fileToImport):\n try:\n sh = xlrd.open_workbook(filename=None, file_contents=fileToImport.read()).sheet_by_index(0)\n except:\n return [\"ERROR: Please upload an .xlsx file. This filetype is not compatible\"]\n num_rooms = 0\n found_end = False\n room_errors = []\n while found_end == False:\n try:\n sh.cell(num_rooms, 0).value\n num_rooms +=1\n except IndexError:\n found_end = True\n\n #Verify sheet has required number of columns\n try:\n sh.cell(0, 1).value\n except:\n room_errors.append(\"ERROR: Insufficient Columns in Sheet. No Data Read\")\n return room_errors\n\n for i in range(1, num_rooms):\n room_name = sh.cell(i, 0).value\n if room_name == '':\n room_errors.append(\"Row \" + str(i) + \": Empty Room Name\")\n continue\n try:\n Room.objects.get(name=room_name)\n room_errors.append(room_name + ': Duplicate Room Name')\n continue\n except:\n pass\n\n #Load and validate room_rank\n room_rank = sh.cell(i, 1).value\n room_string = str(room_rank)\n try:\n room_rank = Decimal(room_rank)\n except:\n room_errors.append(room_name + \": Rank not number\")\n continue\n if len(room_string) > 5 or (room_rank < 10 and len(room_string) > 4):\n room_errors.append(room_name + \": Rank should have no more than two decimal places\")\n continue\n if room_rank >= 100 or room_rank < 0:\n room_errors.append(room_name + \": Rank should be between 0-99.99\")\n continue\n\n #Create the room\n room = Room(name=room_name, rank=room_rank);\n try:\n room.save()\n except:\n room_errors.append(room_name + \": Unknown Error\")\n\n return room_errors", "metadata": "root.import_rooms", "header": "['module', '___EOS___']", "index": 27 } ]
[ { "span": "except:", "start_line": 30, "start_column": 4, "end_line": 30, "end_column": 11 }, { "span": "except:", "start_line": 45, "start_column": 8, "end_line": 45, "end_column": 15 }, { "span": "except:", "start_line": 58, "start_column": 8, "end_line": 58, "end_column": 15 }, { "span": "except:", "start_line": 66, "start_column": 8, "end_line": 66, "end_column": 15 }, { "span": "except:", "start_line": 80, "start_column": 8, "end_line": 80, "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_", "import", "\\u", "rooms_", "(_", "file", "To", "Import_", ")_", ":_", "\\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 ", " _", "sh_", "=_", "xlr", "d_", "._", "open", "\\u", "workbook_", "(_", "filename_", "=_", "None_", ",_", "file", "\\u", "contents_", "=_", "file", "To", "Import_", "._", "read_", "(_", ")_", ")_", "._", "sheet", "\\u", "by", "\\u", "index_", "(_", "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 ", " _", "return_", "[_", "\"", "ERROR", ":", " ", "Ple", "ase", " ", "upload", " ", "an", " ", ".", "xls", "x", " ", "file", ".", " ", "Thi", "s", " ", "filet", "ype", " ", "is", " ", "not", " ", "compatible", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "num", "\\u", "rooms_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "found", "\\u", "end_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "room", "\\u", "errors_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "found", "\\u", "end_", "==_", "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 ", " _", "sh_", "._", "cell_", "(_", "num", "\\u", "rooms_", ",_", "0_", ")_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "rooms_", "+=_", "1_", "\\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 ", " _", "found", "\\u", "end_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Verify", " ", "sheet", " ", "has", " ", "require", "d", " ", "number", " ", "of", " ", "columns_", "\\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 ", " _", "sh_", "._", "cell_", "(_", "0_", ",_", "1_", ")_", "._", "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 ", " _", "room", "\\u", "errors_", "._", "append_", "(_", "\"", "ERROR", ":", " ", "Ins", "uff", "icient", " ", "Colum", "ns", " ", "in", " ", "She", "et", ".", " ", "No", " ", "Data", " ", "Read", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "room", "\\u", "errors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "1_", ",_", "num", "\\u", "rooms_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "room", "\\u", "name_", "=_", "sh_", "._", "cell_", "(_", "i_", ",_", "0_", ")_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "room", "\\u", "name_", "==_", "''_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "room", "\\u", "errors_", "._", "append_", "(_", "\"", "Row", " ", "\"_", "+_", "str_", "(_", "i_", ")_", "+_", "\":", " ", "Emp", "ty", " ", "Room", " ", "Name", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\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 ", " _", "Room_", "._", "objects_", "._", "get_", "(_", "name_", "=_", "room", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "room", "\\u", "errors_", "._", "append_", "(_", "room", "\\u", "name_", "+_", "':", " ", "Duplicate", " ", "Room", " ", "Name", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Load", " ", "and", " ", "validat", "e", " ", "room", "\\u", "rank_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "room", "\\u", "rank_", "=_", "sh_", "._", "cell_", "(_", "i_", ",_", "1_", ")_", "._", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "room", "\\u", "string_", "=_", "str_", "(_", "room", "\\u", "rank_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "room", "\\u", "rank_", "=_", "Decimal_", "(_", "room", "\\u", "rank_", ")_", "\\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 ", " _", "room", "\\u", "errors_", "._", "append_", "(_", "room", "\\u", "name_", "+_", "\":", " ", "Rank", " ", "not", " ", "number", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "room", "\\u", "string_", ")_", ">_", "5_", "or_", "(_", "room", "\\u", "rank_", "<_", "10_", "and_", "len_", "(_", "room", "\\u", "string_", ")_", ">_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "room", "\\u", "errors_", "._", "append_", "(_", "room", "\\u", "name_", "+_", "\":", " ", "Rank", " ", "shou", "ld", " ", "have", " ", "no", " ", "more", " ", "than", " ", "two", " ", "decima", "l", " ", "place", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "room", "\\u", "rank_", ">=_", "100_", "or_", "room", "\\u", "rank_", "<_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "room", "\\u", "errors_", "._", "append_", "(_", "room", "\\u", "name_", "+_", "\":", " ", "Rank", " ", "shou", "ld", " ", "be", " ", "bet", "ween", " ", "0", "-", "99.", "9", "9", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Creat", "e", " ", "the", " ", "room_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "room_", "=_", "Room_", "(_", "name_", "=_", "room", "\\u", "name_", ",_", "rank_", "=_", "room", "\\u", "rank_", ")_", ";_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "room_", "._", "save_", "(_", ")_", "\\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 ", " _", "room", "\\u", "errors_", "._", "append_", "(_", "room", "\\u", "name_", "+_", "\":", " ", "Un", "know", "n", " ", "Error", "\"_", ")_", "\\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_", "room", "\\u", "errors_" ]
[ 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, 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, 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,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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 ]
Conflicting attributes in base classes
Alephbet/gimel/vendor/redis/client.py
[ { "content": "class StrictRedis(object):\n \"\"\"\n Implementation of the Redis protocol.\n\n This abstract class provides a Python interface to all Redis commands\n and an implementation of the Redis protocol.\n\n Connection and Pipeline derive from this, implementing how\n the commands are sent and received to the Redis server\n \"\"\"\n RESPONSE_CALLBACKS = dict_merge(\n string_keys_to_dict(\n 'AUTH EXISTS EXPIRE EXPIREAT HEXISTS HMSET MOVE MSETNX PERSIST '\n 'PSETEX RENAMENX SISMEMBER SMOVE SETEX SETNX',\n bool\n ),\n string_keys_to_dict(\n 'BITCOUNT BITPOS DECRBY DEL GETBIT HDEL HLEN INCRBY LINSERT LLEN '\n 'LPUSHX PFADD PFCOUNT RPUSHX SADD SCARD SDIFFSTORE SETBIT '\n 'SETRANGE SINTERSTORE SREM STRLEN SUNIONSTORE ZADD ZCARD '\n 'ZLEXCOUNT ZREM ZREMRANGEBYLEX ZREMRANGEBYRANK ZREMRANGEBYSCORE',\n int\n ),\n string_keys_to_dict('INCRBYFLOAT HINCRBYFLOAT', float),\n string_keys_to_dict(\n # these return OK, or int if redis-server is >=1.3.4\n 'LPUSH RPUSH',\n lambda r: isinstance(r, long) and r or nativestr(r) == 'OK'\n ),\n string_keys_to_dict('SORT', sort_return_tuples),\n string_keys_to_dict('ZSCORE ZINCRBY', float_or_none),\n string_keys_to_dict(\n 'FLUSHALL FLUSHDB LSET LTRIM MSET PFMERGE RENAME '\n 'SAVE SELECT SHUTDOWN SLAVEOF WATCH UNWATCH',\n bool_ok\n ),\n string_keys_to_dict('BLPOP BRPOP', lambda r: r and tuple(r) or None),\n string_keys_to_dict(\n 'SDIFF SINTER SMEMBERS SUNION',\n lambda r: r and set(r) or set()\n ),\n string_keys_to_dict(\n 'ZRANGE ZRANGEBYSCORE ZREVRANGE ZREVRANGEBYSCORE',\n zset_score_pairs\n ),\n string_keys_to_dict('ZRANK ZREVRANK', int_or_none),\n string_keys_to_dict('BGREWRITEAOF BGSAVE', lambda r: True),\n {\n 'CLIENT GETNAME': lambda r: r and nativestr(r),\n 'CLIENT KILL': bool_ok,\n 'CLIENT LIST': parse_client_list,\n 'CLIENT SETNAME': bool_ok,\n 'CONFIG GET': parse_config_get,\n 'CONFIG RESETSTAT': bool_ok,\n 'CONFIG SET': bool_ok,\n 'DEBUG OBJECT': parse_debug_object,\n 'HGETALL': lambda r: r and pairs_to_dict(r) or {},\n 'HSCAN': parse_hscan,\n 'INFO': parse_info,\n 'LASTSAVE': timestamp_to_datetime,\n 'OBJECT': parse_object,\n 'PING': lambda r: nativestr(r) == 'PONG',\n 'RANDOMKEY': lambda r: r and r or None,\n 'SCAN': parse_scan,\n 'SCRIPT EXISTS': lambda r: list(imap(bool, r)),\n 'SCRIPT FLUSH': bool_ok,\n 'SCRIPT KILL': bool_ok,\n 'SCRIPT LOAD': nativestr,\n 'SENTINEL GET-MASTER-ADDR-BY-NAME': parse_sentinel_get_master,\n 'SENTINEL MASTER': parse_sentinel_master,\n 'SENTINEL MASTERS': parse_sentinel_masters,\n 'SENTINEL MONITOR': bool_ok,\n 'SENTINEL REMOVE': bool_ok,\n 'SENTINEL SENTINELS': parse_sentinel_slaves_and_sentinels,\n 'SENTINEL SET': bool_ok,\n 'SENTINEL SLAVES': parse_sentinel_slaves_and_sentinels,\n 'SET': lambda r: r and nativestr(r) == 'OK',\n 'SLOWLOG GET': parse_slowlog_get,\n 'SLOWLOG LEN': int,\n 'SLOWLOG RESET': bool_ok,\n 'SSCAN': parse_scan,\n 'TIME': lambda x: (int(x[0]), int(x[1])),\n 'ZSCAN': parse_zscan\n }\n )\n\n\n\n\n\n\n\n\n\n # COMMAND EXECUTION AND PROTOCOL PARSING\n\n\n # SERVER INFORMATION\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 # BASIC KEY COMMANDS\n\n\n\n\n\n\n\n\n __contains__ = exists\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 # LIST COMMANDS\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n # SCAN COMMANDS\n\n\n\n\n\n\n\n\n # SET COMMANDS\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n # SORTED SET COMMANDS\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n # HYPERLOGLOG COMMANDS\n\n\n\n # HASH COMMANDS\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.StrictRedis", "header": "['module', '___EOS___']", "index": 281 }, { "content": " @classmethod\n def from_url(cls, url, db=None, **kwargs):\n \"\"\"\n Return a Redis client object configured from the given URL.\n\n For example::\n\n redis://[:password]@localhost:6379/0\n unix://[:password]@/path/to/socket.sock?db=0\n\n There are several ways to specify a database number. The parse function\n will return the first specified option:\n 1. A ``db`` querystring option, e.g. redis://localhost?db=0\n 2. If using the redis:// scheme, the path argument of the url, e.g.\n redis://localhost/0\n 3. The ``db`` argument to this function.\n\n If none of these options are specified, db=0 is used.\n\n Any additional querystring arguments and keyword arguments will be\n passed along to the ConnectionPool class's initializer. In the case\n of conflicting arguments, querystring arguments always win.\n \"\"\"\n connection_pool = ConnectionPool.from_url(url, db=db, **kwargs)\n return cls(connection_pool=connection_pool)", "metadata": "root.StrictRedis.from_url", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 367 }, { "content": " def __init__(self, host='localhost', port=6379,\n db=0, password=None, socket_timeout=None,\n socket_connect_timeout=None,\n socket_keepalive=None, socket_keepalive_options=None,\n connection_pool=None, unix_socket_path=None,\n encoding='utf-8', encoding_errors='strict',\n charset=None, errors=None,\n decode_responses=False, retry_on_timeout=False,\n ssl=False, ssl_keyfile=None, ssl_certfile=None,\n ssl_cert_reqs=None, ssl_ca_certs=None,\n max_connections=None):\n if not connection_pool:\n if charset is not None:\n warnings.warn(DeprecationWarning(\n '\"charset\" is deprecated. Use \"encoding\" instead'))\n encoding = charset\n if errors is not None:\n warnings.warn(DeprecationWarning(\n '\"errors\" is deprecated. Use \"encoding_errors\" instead'))\n encoding_errors = errors\n\n kwargs = {\n 'db': db,\n 'password': password,\n 'socket_timeout': socket_timeout,\n 'encoding': encoding,\n 'encoding_errors': encoding_errors,\n 'decode_responses': decode_responses,\n 'retry_on_timeout': retry_on_timeout,\n 'max_connections': max_connections\n }\n # based on input, setup appropriate connection args\n if unix_socket_path is not None:\n kwargs.update({\n 'path': unix_socket_path,\n 'connection_class': UnixDomainSocketConnection\n })\n else:\n # TCP specific options\n kwargs.update({\n 'host': host,\n 'port': port,\n 'socket_connect_timeout': socket_connect_timeout,\n 'socket_keepalive': socket_keepalive,\n 'socket_keepalive_options': socket_keepalive_options,\n })\n\n if ssl:\n kwargs.update({\n 'connection_class': SSLConnection,\n 'ssl_keyfile': ssl_keyfile,\n 'ssl_certfile': ssl_certfile,\n 'ssl_cert_reqs': ssl_cert_reqs,\n 'ssl_ca_certs': ssl_ca_certs,\n })\n connection_pool = ConnectionPool(**kwargs)\n self.connection_pool = connection_pool\n self._use_lua_lock = None\n\n self.response_callbacks = self.__class__.RESPONSE_CALLBACKS.copy()", "metadata": "root.StrictRedis.__init__", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 393 }, { "content": " def __repr__(self):\n return \"%s<%s>\" % (type(self).__name__, repr(self.connection_pool))", "metadata": "root.StrictRedis.__repr__", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 454 }, { "content": " def set_response_callback(self, command, callback):\n \"Set a custom Response Callback\"\n self.response_callbacks[command] = callback", "metadata": "root.StrictRedis.set_response_callback", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 457 }, { "content": " def pipeline(self, transaction=True, shard_hint=None):\n \"\"\"\n Return a new pipeline object that can queue multiple commands for\n later execution. ``transaction`` indicates whether all commands\n should be executed atomically. Apart from making a group of operations\n atomic, pipelines are useful for reducing the back-and-forth overhead\n between the client and server.\n \"\"\"\n return StrictPipeline(\n self.connection_pool,\n self.response_callbacks,\n transaction,\n shard_hint)", "metadata": "root.StrictRedis.pipeline", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 461 }, { "content": " def transaction(self, func, *watches, **kwargs):\n \"\"\"\n Convenience method for executing the callable `func` as a transaction\n while watching all keys specified in `watches`. The 'func' callable\n should expect a single argument which is a Pipeline object.\n \"\"\"\n shard_hint = kwargs.pop('shard_hint', None)\n value_from_callable = kwargs.pop('value_from_callable', False)\n watch_delay = kwargs.pop('watch_delay', None)\n with self.pipeline(True, shard_hint) as pipe:\n while 1:\n try:\n if watches:\n pipe.watch(*watches)\n func_value = func(pipe)\n exec_value = pipe.execute()\n return func_value if value_from_callable else exec_value\n except WatchError:\n if watch_delay is not None and watch_delay > 0:\n time.sleep(watch_delay)\n continue", "metadata": "root.StrictRedis.transaction", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 475 }, { "content": " def lock(self, name, timeout=None, sleep=0.1, blocking_timeout=None,\n lock_class=None, thread_local=True):\n \"\"\"\n Return a new Lock object using key ``name`` that mimics\n the behavior of threading.Lock.\n\n If specified, ``timeout`` indicates a maximum life for the lock.\n By default, it will remain locked until release() is called.\n\n ``sleep`` indicates the amount of time to sleep per loop iteration\n when the lock is in blocking mode and another client is currently\n holding the lock.\n\n ``blocking_timeout`` indicates the maximum amount of time in seconds to\n spend trying to acquire the lock. A value of ``None`` indicates\n continue trying forever. ``blocking_timeout`` can be specified as a\n float or integer, both representing the number of seconds to wait.\n\n ``lock_class`` forces the specified lock implementation.\n\n ``thread_local`` indicates whether the lock token is placed in\n thread-local storage. By default, the token is placed in thread local\n storage so that a thread only sees its token, not a token set by\n another thread. Consider the following timeline:\n\n time: 0, thread-1 acquires `my-lock`, with a timeout of 5 seconds.\n thread-1 sets the token to \"abc\"\n time: 1, thread-2 blocks trying to acquire `my-lock` using the\n Lock instance.\n time: 5, thread-1 has not yet completed. redis expires the lock\n key.\n time: 5, thread-2 acquired `my-lock` now that it's available.\n thread-2 sets the token to \"xyz\"\n time: 6, thread-1 finishes its work and calls release(). if the\n token is *not* stored in thread local storage, then\n thread-1 would see the token value as \"xyz\" and would be\n able to successfully release the thread-2's lock.\n\n In some use cases it's necessary to disable thread local storage. For\n example, if you have code where one thread acquires a lock and passes\n that lock instance to a worker thread to release later. If thread\n local storage isn't disabled in this case, the worker thread won't see\n the token set by the thread that acquired the lock. Our assumption\n is that these cases aren't common and as such default to using\n thread local storage. \"\"\"\n if lock_class is None:\n if self._use_lua_lock is None:\n # the first time .lock() is called, determine if we can use\n # Lua by attempting to register the necessary scripts\n try:\n LuaLock.register_scripts(self)\n self._use_lua_lock = True\n except ResponseError:\n self._use_lua_lock = False\n lock_class = self._use_lua_lock and LuaLock or Lock\n return lock_class(self, name, timeout=timeout, sleep=sleep,\n blocking_timeout=blocking_timeout,\n thread_local=thread_local)", "metadata": "root.StrictRedis.lock", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 497 }, { "content": " def pubsub(self, **kwargs):\n \"\"\"\n Return a Publish/Subscribe object. With this object, you can\n subscribe to channels and listen for messages that get published to\n them.\n \"\"\"\n return PubSub(self.connection_pool, **kwargs)", "metadata": "root.StrictRedis.pubsub", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 556 }, { "content": " def execute_command(self, *args, **options):\n \"Execute a command and return a parsed response\"\n pool = self.connection_pool\n command_name = args[0]\n connection = pool.get_connection(command_name, **options)\n try:\n connection.send_command(*args)\n return self.parse_response(connection, command_name, **options)\n except (ConnectionError, TimeoutError) as e:\n connection.disconnect()\n if not connection.retry_on_timeout and isinstance(e, TimeoutError):\n raise\n connection.send_command(*args)\n return self.parse_response(connection, command_name, **options)\n finally:\n pool.release(connection)", "metadata": "root.StrictRedis.execute_command", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 565 }, { "content": " def parse_response(self, connection, command_name, **options):\n \"Parses a response from the Redis server\"\n response = connection.read_response()\n if command_name in self.response_callbacks:\n return self.response_callbacks[command_name](response, **options)\n return response", "metadata": "root.StrictRedis.parse_response", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 582 }, { "content": " def bgrewriteaof(self):\n \"Tell the Redis server to rewrite the AOF file from data in memory.\"\n return self.execute_command('BGREWRITEAOF')", "metadata": "root.StrictRedis.bgrewriteaof", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 590 }, { "content": " def bgsave(self):\n \"\"\"\n Tell the Redis server to save its data to disk. Unlike save(),\n this method is asynchronous and returns immediately.\n \"\"\"\n return self.execute_command('BGSAVE')", "metadata": "root.StrictRedis.bgsave", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 594 }, { "content": " def client_kill(self, address):\n \"Disconnects the client at ``address`` (ip:port)\"\n return self.execute_command('CLIENT KILL', address)", "metadata": "root.StrictRedis.client_kill", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 601 }, { "content": " def client_list(self):\n \"Returns a list of currently connected clients\"\n return self.execute_command('CLIENT LIST')", "metadata": "root.StrictRedis.client_list", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 605 }, { "content": " def client_getname(self):\n \"Returns the current connection name\"\n return self.execute_command('CLIENT GETNAME')", "metadata": "root.StrictRedis.client_getname", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 609 }, { "content": " def client_setname(self, name):\n \"Sets the current connection name\"\n return self.execute_command('CLIENT SETNAME', name)", "metadata": "root.StrictRedis.client_setname", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 613 }, { "content": " def config_get(self, pattern=\"*\"):\n \"Return a dictionary of configuration based on the ``pattern``\"\n return self.execute_command('CONFIG GET', pattern)", "metadata": "root.StrictRedis.config_get", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 617 }, { "content": " def config_set(self, name, value):\n \"Set config item ``name`` with ``value``\"\n return self.execute_command('CONFIG SET', name, value)", "metadata": "root.StrictRedis.config_set", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 621 }, { "content": " def config_resetstat(self):\n \"Reset runtime statistics\"\n return self.execute_command('CONFIG RESETSTAT')", "metadata": "root.StrictRedis.config_resetstat", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 625 }, { "content": " def config_rewrite(self):\n \"Rewrite config file with the minimal change to reflect running config\"\n return self.execute_command('CONFIG REWRITE')", "metadata": "root.StrictRedis.config_rewrite", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 629 }, { "content": " def dbsize(self):\n \"Returns the number of keys in the current database\"\n return self.execute_command('DBSIZE')", "metadata": "root.StrictRedis.dbsize", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 633 }, { "content": " def debug_object(self, key):\n \"Returns version specific meta information about a given key\"\n return self.execute_command('DEBUG OBJECT', key)", "metadata": "root.StrictRedis.debug_object", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 637 }, { "content": " def echo(self, value):\n \"Echo the string back from the server\"\n return self.execute_command('ECHO', value)", "metadata": "root.StrictRedis.echo", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 641 }, { "content": " def flushall(self):\n \"Delete all keys in all databases on the current host\"\n return self.execute_command('FLUSHALL')", "metadata": "root.StrictRedis.flushall", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 645 }, { "content": " def flushdb(self):\n \"Delete all keys in the current database\"\n return self.execute_command('FLUSHDB')", "metadata": "root.StrictRedis.flushdb", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 649 }, { "content": " def info(self, section=None):\n \"\"\"\n Returns a dictionary containing information about the Redis server\n\n The ``section`` option can be used to select a specific section\n of information\n\n The section option is not supported by older versions of Redis Server,\n and will generate ResponseError\n \"\"\"\n if section is None:\n return self.execute_command('INFO')\n else:\n return self.execute_command('INFO', section)", "metadata": "root.StrictRedis.info", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 653 }, { "content": " def lastsave(self):\n \"\"\"\n Return a Python datetime object representing the last time the\n Redis database was saved to disk\n \"\"\"\n return self.execute_command('LASTSAVE')", "metadata": "root.StrictRedis.lastsave", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 668 }, { "content": " def object(self, infotype, key):\n \"Return the encoding, idletime, or refcount about the key\"\n return self.execute_command('OBJECT', infotype, key, infotype=infotype)", "metadata": "root.StrictRedis.object", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 675 }, { "content": " def ping(self):\n \"Ping the Redis server\"\n return self.execute_command('PING')", "metadata": "root.StrictRedis.ping", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 679 }, { "content": " def save(self):\n \"\"\"\n Tell the Redis server to save its data to disk,\n blocking until the save is complete\n \"\"\"\n return self.execute_command('SAVE')", "metadata": "root.StrictRedis.save", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 683 }, { "content": " def sentinel(self, *args):\n \"Redis Sentinel's SENTINEL command.\"\n warnings.warn(\n DeprecationWarning('Use the individual sentinel_* methods'))", "metadata": "root.StrictRedis.sentinel", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 690 }, { "content": " def sentinel_get_master_addr_by_name(self, service_name):\n \"Returns a (host, port) pair for the given ``service_name``\"\n return self.execute_command('SENTINEL GET-MASTER-ADDR-BY-NAME',\n service_name)", "metadata": "root.StrictRedis.sentinel_get_master_addr_by_name", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 695 }, { "content": " def sentinel_master(self, service_name):\n \"Returns a dictionary containing the specified masters state.\"\n return self.execute_command('SENTINEL MASTER', service_name)", "metadata": "root.StrictRedis.sentinel_master", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 700 }, { "content": " def sentinel_masters(self):\n \"Returns a list of dictionaries containing each master's state.\"\n return self.execute_command('SENTINEL MASTERS')", "metadata": "root.StrictRedis.sentinel_masters", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 704 }, { "content": " def sentinel_monitor(self, name, ip, port, quorum):\n \"Add a new master to Sentinel to be monitored\"\n return self.execute_command('SENTINEL MONITOR', name, ip, port, quorum)", "metadata": "root.StrictRedis.sentinel_monitor", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 708 }, { "content": " def sentinel_remove(self, name):\n \"Remove a master from Sentinel's monitoring\"\n return self.execute_command('SENTINEL REMOVE', name)", "metadata": "root.StrictRedis.sentinel_remove", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 712 }, { "content": " def sentinel_sentinels(self, service_name):\n \"Returns a list of sentinels for ``service_name``\"\n return self.execute_command('SENTINEL SENTINELS', service_name)", "metadata": "root.StrictRedis.sentinel_sentinels", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 716 }, { "content": " def sentinel_set(self, name, option, value):\n \"Set Sentinel monitoring parameters for a given master\"\n return self.execute_command('SENTINEL SET', name, option, value)", "metadata": "root.StrictRedis.sentinel_set", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 720 }, { "content": " def sentinel_slaves(self, service_name):\n \"Returns a list of slaves for ``service_name``\"\n return self.execute_command('SENTINEL SLAVES', service_name)", "metadata": "root.StrictRedis.sentinel_slaves", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 724 }, { "content": " def shutdown(self):\n \"Shutdown the server\"\n try:\n self.execute_command('SHUTDOWN')\n except ConnectionError:\n # a ConnectionError here is expected\n return\n raise RedisError(\"SHUTDOWN seems to have failed.\")", "metadata": "root.StrictRedis.shutdown", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 728 }, { "content": " def slaveof(self, host=None, port=None):\n \"\"\"\n Set the server to be a replicated slave of the instance identified\n by the ``host`` and ``port``. If called without arguments, the\n instance is promoted to a master instead.\n \"\"\"\n if host is None and port is None:\n return self.execute_command('SLAVEOF', Token('NO'), Token('ONE'))\n return self.execute_command('SLAVEOF', host, port)", "metadata": "root.StrictRedis.slaveof", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 737 }, { "content": " def slowlog_get(self, num=None):\n \"\"\"\n Get the entries from the slowlog. If ``num`` is specified, get the\n most recent ``num`` items.\n \"\"\"\n args = ['SLOWLOG GET']\n if num is not None:\n args.append(num)\n return self.execute_command(*args)", "metadata": "root.StrictRedis.slowlog_get", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 747 }, { "content": " def slowlog_len(self):\n \"Get the number of items in the slowlog\"\n return self.execute_command('SLOWLOG LEN')", "metadata": "root.StrictRedis.slowlog_len", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 757 }, { "content": " def slowlog_reset(self):\n \"Remove all items in the slowlog\"\n return self.execute_command('SLOWLOG RESET')", "metadata": "root.StrictRedis.slowlog_reset", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 761 }, { "content": " def time(self):\n \"\"\"\n Returns the server time as a 2-item tuple of ints:\n (seconds since epoch, microseconds into this second).\n \"\"\"\n return self.execute_command('TIME')", "metadata": "root.StrictRedis.time", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 765 }, { "content": " def wait(self, num_replicas, timeout):\n \"\"\"\n Redis synchronous replication\n That returns the number of replicas that processed the query when\n we finally have at least ``num_replicas``, or when the ``timeout`` was\n reached.\n \"\"\"\n return self.execute_command('WAIT', num_replicas, timeout)", "metadata": "root.StrictRedis.wait", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 772 }, { "content": " def append(self, key, value):\n \"\"\"\n Appends the string ``value`` to the value at ``key``. If ``key``\n doesn't already exist, create it with a value of ``value``.\n Returns the new length of the value at ``key``.\n \"\"\"\n return self.execute_command('APPEND', key, value)", "metadata": "root.StrictRedis.append", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 782 }, { "content": " def bitcount(self, key, start=None, end=None):\n \"\"\"\n Returns the count of set bits in the value of ``key``. Optional\n ``start`` and ``end`` paramaters indicate which bytes to consider\n \"\"\"\n params = [key]\n if start is not None and end is not None:\n params.append(start)\n params.append(end)\n elif (start is not None and end is None) or \\\n (end is not None and start is None):\n raise RedisError(\"Both start and end must be specified\")\n return self.execute_command('BITCOUNT', *params)", "metadata": "root.StrictRedis.bitcount", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 790 }, { "content": " def bitop(self, operation, dest, *keys):\n \"\"\"\n Perform a bitwise operation using ``operation`` between ``keys`` and\n store the result in ``dest``.\n \"\"\"\n return self.execute_command('BITOP', operation, dest, *keys)", "metadata": "root.StrictRedis.bitop", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 804 }, { "content": " def bitpos(self, key, bit, start=None, end=None):\n \"\"\"\n Return the position of the first bit set to 1 or 0 in a string.\n ``start`` and ``end`` difines search range. The range is interpreted\n as a range of bytes and not a range of bits, so start=0 and end=2\n means to look at the first three bytes.\n \"\"\"\n if bit not in (0, 1):\n raise RedisError('bit must be 0 or 1')\n params = [key, bit]\n\n start is not None and params.append(start)\n\n if start is not None and end is not None:\n params.append(end)\n elif start is None and end is not None:\n raise RedisError(\"start argument is not set, \"\n \"when end is specified\")\n return self.execute_command('BITPOS', *params)", "metadata": "root.StrictRedis.bitpos", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 811 }, { "content": " def decr(self, name, amount=1):\n \"\"\"\n Decrements the value of ``key`` by ``amount``. If no key exists,\n the value will be initialized as 0 - ``amount``\n \"\"\"\n return self.execute_command('DECRBY', name, amount)", "metadata": "root.StrictRedis.decr", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 831 }, { "content": " def delete(self, *names):\n \"Delete one or more keys specified by ``names``\"\n return self.execute_command('DEL', *names)", "metadata": "root.StrictRedis.delete", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 838 }, { "content": " def __delitem__(self, name):\n self.delete(name)", "metadata": "root.StrictRedis.__delitem__", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 842 }, { "content": " def dump(self, name):\n \"\"\"\n Return a serialized version of the value stored at the specified key.\n If key does not exist a nil bulk reply is returned.\n \"\"\"\n return self.execute_command('DUMP', name)", "metadata": "root.StrictRedis.dump", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 845 }, { "content": " def exists(self, name):\n \"Returns a boolean indicating whether key ``name`` exists\"\n return self.execute_command('EXISTS', name)", "metadata": "root.StrictRedis.exists", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 852 }, { "content": " def expire(self, name, time):\n \"\"\"\n Set an expire flag on key ``name`` for ``time`` seconds. ``time``\n can be represented by an integer or a Python timedelta object.\n \"\"\"\n if isinstance(time, datetime.timedelta):\n time = time.seconds + time.days * 24 * 3600\n return self.execute_command('EXPIRE', name, time)", "metadata": "root.StrictRedis.expire", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 857 }, { "content": " def expireat(self, name, when):\n \"\"\"\n Set an expire flag on key ``name``. ``when`` can be represented\n as an integer indicating unix time or a Python datetime object.\n \"\"\"\n if isinstance(when, datetime.datetime):\n when = int(mod_time.mktime(when.timetuple()))\n return self.execute_command('EXPIREAT', name, when)", "metadata": "root.StrictRedis.expireat", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 866 }, { "content": " def get(self, name):\n \"\"\"\n Return the value at key ``name``, or None if the key doesn't exist\n \"\"\"\n return self.execute_command('GET', name)", "metadata": "root.StrictRedis.get", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 875 }, { "content": " def __getitem__(self, name):\n \"\"\"\n Return the value at key ``name``, raises a KeyError if the key\n doesn't exist.\n \"\"\"\n value = self.get(name)\n if value:\n return value\n raise KeyError(name)", "metadata": "root.StrictRedis.__getitem__", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 881 }, { "content": " def getbit(self, name, offset):\n \"Returns a boolean indicating the value of ``offset`` in ``name``\"\n return self.execute_command('GETBIT', name, offset)", "metadata": "root.StrictRedis.getbit", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 891 }, { "content": " def getrange(self, key, start, end):\n \"\"\"\n Returns the substring of the string value stored at ``key``,\n determined by the offsets ``start`` and ``end`` (both are inclusive)\n \"\"\"\n return self.execute_command('GETRANGE', key, start, end)", "metadata": "root.StrictRedis.getrange", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 895 }, { "content": " def getset(self, name, value):\n \"\"\"\n Sets the value at key ``name`` to ``value``\n and returns the old value at key ``name`` atomically.\n \"\"\"\n return self.execute_command('GETSET', name, value)", "metadata": "root.StrictRedis.getset", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 902 }, { "content": " def incr(self, name, amount=1):\n \"\"\"\n Increments the value of ``key`` by ``amount``. If no key exists,\n the value will be initialized as ``amount``\n \"\"\"\n return self.execute_command('INCRBY', name, amount)", "metadata": "root.StrictRedis.incr", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 909 }, { "content": " def incrby(self, name, amount=1):\n \"\"\"\n Increments the value of ``key`` by ``amount``. If no key exists,\n the value will be initialized as ``amount``\n \"\"\"\n\n # An alias for ``incr()``, because it is already implemented\n # as INCRBY redis command.\n return self.incr(name, amount)", "metadata": "root.StrictRedis.incrby", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 916 }, { "content": " def incrbyfloat(self, name, amount=1.0):\n \"\"\"\n Increments the value at key ``name`` by floating ``amount``.\n If no key exists, the value will be initialized as ``amount``\n \"\"\"\n return self.execute_command('INCRBYFLOAT', name, amount)", "metadata": "root.StrictRedis.incrbyfloat", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 926 }, { "content": " def keys(self, pattern='*'):\n \"Returns a list of keys matching ``pattern``\"\n return self.execute_command('KEYS', pattern)", "metadata": "root.StrictRedis.keys", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 933 }, { "content": " def mget(self, keys, *args):\n \"\"\"\n Returns a list of values ordered identically to ``keys``\n \"\"\"\n args = list_or_args(keys, args)\n return self.execute_command('MGET', *args)", "metadata": "root.StrictRedis.mget", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 937 }, { "content": " def mset(self, *args, **kwargs):\n \"\"\"\n Sets key/values based on a mapping. Mapping can be supplied as a single\n dictionary argument or as kwargs.\n \"\"\"\n if args:\n if len(args) != 1 or not isinstance(args[0], dict):\n raise RedisError('MSET requires **kwargs or a single dict arg')\n kwargs.update(args[0])\n items = []\n for pair in iteritems(kwargs):\n items.extend(pair)\n return self.execute_command('MSET', *items)", "metadata": "root.StrictRedis.mset", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 944 }, { "content": " def msetnx(self, *args, **kwargs):\n \"\"\"\n Sets key/values based on a mapping if none of the keys are already set.\n Mapping can be supplied as a single dictionary argument or as kwargs.\n Returns a boolean indicating if the operation was successful.\n \"\"\"\n if args:\n if len(args) != 1 or not isinstance(args[0], dict):\n raise RedisError('MSETNX requires **kwargs or a single '\n 'dict arg')\n kwargs.update(args[0])\n items = []\n for pair in iteritems(kwargs):\n items.extend(pair)\n return self.execute_command('MSETNX', *items)", "metadata": "root.StrictRedis.msetnx", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 958 }, { "content": " def move(self, name, db):\n \"Moves the key ``name`` to a different Redis database ``db``\"\n return self.execute_command('MOVE', name, db)", "metadata": "root.StrictRedis.move", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 974 }, { "content": " def persist(self, name):\n \"Removes an expiration on ``name``\"\n return self.execute_command('PERSIST', name)", "metadata": "root.StrictRedis.persist", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 978 }, { "content": " def pexpire(self, name, time):\n \"\"\"\n Set an expire flag on key ``name`` for ``time`` milliseconds.\n ``time`` can be represented by an integer or a Python timedelta\n object.\n \"\"\"\n if isinstance(time, datetime.timedelta):\n ms = int(time.microseconds / 1000)\n time = (time.seconds + time.days * 24 * 3600) * 1000 + ms\n return self.execute_command('PEXPIRE', name, time)", "metadata": "root.StrictRedis.pexpire", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 982 }, { "content": " def pexpireat(self, name, when):\n \"\"\"\n Set an expire flag on key ``name``. ``when`` can be represented\n as an integer representing unix time in milliseconds (unix time * 1000)\n or a Python datetime object.\n \"\"\"\n if isinstance(when, datetime.datetime):\n ms = int(when.microsecond / 1000)\n when = int(mod_time.mktime(when.timetuple())) * 1000 + ms\n return self.execute_command('PEXPIREAT', name, when)", "metadata": "root.StrictRedis.pexpireat", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 993 }, { "content": " def psetex(self, name, time_ms, value):\n \"\"\"\n Set the value of key ``name`` to ``value`` that expires in ``time_ms``\n milliseconds. ``time_ms`` can be represented by an integer or a Python\n timedelta object\n \"\"\"\n if isinstance(time_ms, datetime.timedelta):\n ms = int(time_ms.microseconds / 1000)\n time_ms = (time_ms.seconds + time_ms.days * 24 * 3600) * 1000 + ms\n return self.execute_command('PSETEX', name, time_ms, value)", "metadata": "root.StrictRedis.psetex", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1004 }, { "content": " def pttl(self, name):\n \"Returns the number of milliseconds until the key ``name`` will expire\"\n return self.execute_command('PTTL', name)", "metadata": "root.StrictRedis.pttl", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1015 }, { "content": " def randomkey(self):\n \"Returns the name of a random key\"\n return self.execute_command('RANDOMKEY')", "metadata": "root.StrictRedis.randomkey", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1019 }, { "content": " def rename(self, src, dst):\n \"\"\"\n Rename key ``src`` to ``dst``\n \"\"\"\n return self.execute_command('RENAME', src, dst)", "metadata": "root.StrictRedis.rename", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1023 }, { "content": " def renamenx(self, src, dst):\n \"Rename key ``src`` to ``dst`` if ``dst`` doesn't already exist\"\n return self.execute_command('RENAMENX', src, dst)", "metadata": "root.StrictRedis.renamenx", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1029 }, { "content": " def restore(self, name, ttl, value):\n \"\"\"\n Create a key using the provided serialized value, previously obtained\n using DUMP.\n \"\"\"\n return self.execute_command('RESTORE', name, ttl, value)", "metadata": "root.StrictRedis.restore", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1033 }, { "content": " def set(self, name, value, ex=None, px=None, nx=False, xx=False):\n \"\"\"\n Set the value at key ``name`` to ``value``\n\n ``ex`` sets an expire flag on key ``name`` for ``ex`` seconds.\n\n ``px`` sets an expire flag on key ``name`` for ``px`` milliseconds.\n\n ``nx`` if set to True, set the value at key ``name`` to ``value`` if it\n does not already exist.\n\n ``xx`` if set to True, set the value at key ``name`` to ``value`` if it\n already exists.\n \"\"\"\n pieces = [name, value]\n if ex:\n pieces.append('EX')\n if isinstance(ex, datetime.timedelta):\n ex = ex.seconds + ex.days * 24 * 3600\n pieces.append(ex)\n if px:\n pieces.append('PX')\n if isinstance(px, datetime.timedelta):\n ms = int(px.microseconds / 1000)\n px = (px.seconds + px.days * 24 * 3600) * 1000 + ms\n pieces.append(px)\n\n if nx:\n pieces.append('NX')\n if xx:\n pieces.append('XX')\n return self.execute_command('SET', *pieces)", "metadata": "root.StrictRedis.set", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1040 }, { "content": " def __setitem__(self, name, value):\n self.set(name, value)", "metadata": "root.StrictRedis.__setitem__", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1073 }, { "content": " def setbit(self, name, offset, value):\n \"\"\"\n Flag the ``offset`` in ``name`` as ``value``. Returns a boolean\n indicating the previous value of ``offset``.\n \"\"\"\n value = value and 1 or 0\n return self.execute_command('SETBIT', name, offset, value)", "metadata": "root.StrictRedis.setbit", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1076 }, { "content": " def setex(self, name, time, value):\n \"\"\"\n Set the value of key ``name`` to ``value`` that expires in ``time``\n seconds. ``time`` can be represented by an integer or a Python\n timedelta object.\n \"\"\"\n if isinstance(time, datetime.timedelta):\n time = time.seconds + time.days * 24 * 3600\n return self.execute_command('SETEX', name, time, value)", "metadata": "root.StrictRedis.setex", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1084 }, { "content": " def setnx(self, name, value):\n \"Set the value of key ``name`` to ``value`` if key doesn't exist\"\n return self.execute_command('SETNX', name, value)", "metadata": "root.StrictRedis.setnx", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1094 }, { "content": " def setrange(self, name, offset, value):\n \"\"\"\n Overwrite bytes in the value of ``name`` starting at ``offset`` with\n ``value``. If ``offset`` plus the length of ``value`` exceeds the\n length of the original value, the new value will be larger than before.\n If ``offset`` exceeds the length of the original value, null bytes\n will be used to pad between the end of the previous value and the start\n of what's being injected.\n\n Returns the length of the new string.\n \"\"\"\n return self.execute_command('SETRANGE', name, offset, value)", "metadata": "root.StrictRedis.setrange", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1098 }, { "content": " def strlen(self, name):\n \"Return the number of bytes stored in the value of ``name``\"\n return self.execute_command('STRLEN', name)", "metadata": "root.StrictRedis.strlen", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1111 }, { "content": " def substr(self, name, start, end=-1):\n \"\"\"\n Return a substring of the string at key ``name``. ``start`` and ``end``\n are 0-based integers specifying the portion of the string to return.\n \"\"\"\n return self.execute_command('SUBSTR', name, start, end)", "metadata": "root.StrictRedis.substr", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1115 }, { "content": " def ttl(self, name):\n \"Returns the number of seconds until the key ``name`` will expire\"\n return self.execute_command('TTL', name)", "metadata": "root.StrictRedis.ttl", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1122 }, { "content": " def type(self, name):\n \"Returns the type of key ``name``\"\n return self.execute_command('TYPE', name)", "metadata": "root.StrictRedis.type", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1126 }, { "content": " def watch(self, *names):\n \"\"\"\n Watches the values at keys ``names``, or None if the key doesn't exist\n \"\"\"\n warnings.warn(DeprecationWarning('Call WATCH from a Pipeline object'))", "metadata": "root.StrictRedis.watch", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1130 }, { "content": " def unwatch(self):\n \"\"\"\n Unwatches the value at key ``name``, or None of the key doesn't exist\n \"\"\"\n warnings.warn(\n DeprecationWarning('Call UNWATCH from a Pipeline object'))", "metadata": "root.StrictRedis.unwatch", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1136 }, { "content": " def blpop(self, keys, timeout=0):\n \"\"\"\n LPOP a value off of the first non-empty list\n named in the ``keys`` list.\n\n If none of the lists in ``keys`` has a value to LPOP, then block\n for ``timeout`` seconds, or until a value gets pushed on to one\n of the lists.\n\n If timeout is 0, then block indefinitely.\n \"\"\"\n if timeout is None:\n timeout = 0\n if isinstance(keys, basestring):\n keys = [keys]\n else:\n keys = list(keys)\n keys.append(timeout)\n return self.execute_command('BLPOP', *keys)", "metadata": "root.StrictRedis.blpop", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1144 }, { "content": " def brpop(self, keys, timeout=0):\n \"\"\"\n RPOP a value off of the first non-empty list\n named in the ``keys`` list.\n\n If none of the lists in ``keys`` has a value to LPOP, then block\n for ``timeout`` seconds, or until a value gets pushed on to one\n of the lists.\n\n If timeout is 0, then block indefinitely.\n \"\"\"\n if timeout is None:\n timeout = 0\n if isinstance(keys, basestring):\n keys = [keys]\n else:\n keys = list(keys)\n keys.append(timeout)\n return self.execute_command('BRPOP', *keys)", "metadata": "root.StrictRedis.brpop", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1164 }, { "content": " def brpoplpush(self, src, dst, timeout=0):\n \"\"\"\n Pop a value off the tail of ``src``, push it on the head of ``dst``\n and then return it.\n\n This command blocks until a value is in ``src`` or until ``timeout``\n seconds elapse, whichever is first. A ``timeout`` value of 0 blocks\n forever.\n \"\"\"\n if timeout is None:\n timeout = 0\n return self.execute_command('BRPOPLPUSH', src, dst, timeout)", "metadata": "root.StrictRedis.brpoplpush", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1184 }, { "content": " def lindex(self, name, index):\n \"\"\"\n Return the item from list ``name`` at position ``index``\n\n Negative indexes are supported and will return an item at the\n end of the list\n \"\"\"\n return self.execute_command('LINDEX', name, index)", "metadata": "root.StrictRedis.lindex", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1197 }, { "content": " def linsert(self, name, where, refvalue, value):\n \"\"\"\n Insert ``value`` in list ``name`` either immediately before or after\n [``where``] ``refvalue``\n\n Returns the new length of the list on success or -1 if ``refvalue``\n is not in the list.\n \"\"\"\n return self.execute_command('LINSERT', name, where, refvalue, value)", "metadata": "root.StrictRedis.linsert", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1206 }, { "content": " def llen(self, name):\n \"Return the length of the list ``name``\"\n return self.execute_command('LLEN', name)", "metadata": "root.StrictRedis.llen", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1216 }, { "content": " def lpop(self, name):\n \"Remove and return the first item of the list ``name``\"\n return self.execute_command('LPOP', name)", "metadata": "root.StrictRedis.lpop", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1220 }, { "content": " def lpush(self, name, *values):\n \"Push ``values`` onto the head of the list ``name``\"\n return self.execute_command('LPUSH', name, *values)", "metadata": "root.StrictRedis.lpush", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1224 }, { "content": " def lpushx(self, name, value):\n \"Push ``value`` onto the head of the list ``name`` if ``name`` exists\"\n return self.execute_command('LPUSHX', name, value)", "metadata": "root.StrictRedis.lpushx", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1228 }, { "content": " def lrange(self, name, start, end):\n \"\"\"\n Return a slice of the list ``name`` between\n position ``start`` and ``end``\n\n ``start`` and ``end`` can be negative numbers just like\n Python slicing notation\n \"\"\"\n return self.execute_command('LRANGE', name, start, end)", "metadata": "root.StrictRedis.lrange", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1232 }, { "content": " def lrem(self, name, count, value):\n \"\"\"\n Remove the first ``count`` occurrences of elements equal to ``value``\n from the list stored at ``name``.\n\n The count argument influences the operation in the following ways:\n count > 0: Remove elements equal to value moving from head to tail.\n count < 0: Remove elements equal to value moving from tail to head.\n count = 0: Remove all elements equal to value.\n \"\"\"\n return self.execute_command('LREM', name, count, value)", "metadata": "root.StrictRedis.lrem", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1242 }, { "content": " def lset(self, name, index, value):\n \"Set ``position`` of list ``name`` to ``value``\"\n return self.execute_command('LSET', name, index, value)", "metadata": "root.StrictRedis.lset", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1254 }, { "content": " def ltrim(self, name, start, end):\n \"\"\"\n Trim the list ``name``, removing all values not within the slice\n between ``start`` and ``end``\n\n ``start`` and ``end`` can be negative numbers just like\n Python slicing notation\n \"\"\"\n return self.execute_command('LTRIM', name, start, end)", "metadata": "root.StrictRedis.ltrim", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1258 }, { "content": " def rpop(self, name):\n \"Remove and return the last item of the list ``name``\"\n return self.execute_command('RPOP', name)", "metadata": "root.StrictRedis.rpop", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1268 }, { "content": " def rpoplpush(self, src, dst):\n \"\"\"\n RPOP a value off of the ``src`` list and atomically LPUSH it\n on to the ``dst`` list. Returns the value.\n \"\"\"\n return self.execute_command('RPOPLPUSH', src, dst)", "metadata": "root.StrictRedis.rpoplpush", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1272 }, { "content": " def rpush(self, name, *values):\n \"Push ``values`` onto the tail of the list ``name``\"\n return self.execute_command('RPUSH', name, *values)", "metadata": "root.StrictRedis.rpush", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1279 }, { "content": " def rpushx(self, name, value):\n \"Push ``value`` onto the tail of the list ``name`` if ``name`` exists\"\n return self.execute_command('RPUSHX', name, value)", "metadata": "root.StrictRedis.rpushx", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1283 }, { "content": " def sort(self, name, start=None, num=None, by=None, get=None,\n desc=False, alpha=False, store=None, groups=False):\n \"\"\"\n Sort and return the list, set or sorted set at ``name``.\n\n ``start`` and ``num`` allow for paging through the sorted data\n\n ``by`` allows using an external key to weight and sort the items.\n Use an \"*\" to indicate where in the key the item value is located\n\n ``get`` allows for returning items from external keys rather than the\n sorted data itself. Use an \"*\" to indicate where int he key\n the item value is located\n\n ``desc`` allows for reversing the sort\n\n ``alpha`` allows for sorting lexicographically rather than numerically\n\n ``store`` allows for storing the result of the sort into\n the key ``store``\n\n ``groups`` if set to True and if ``get`` contains at least two\n elements, sort will return a list of tuples, each containing the\n values fetched from the arguments to ``get``.\n\n \"\"\"\n if (start is not None and num is None) or \\\n (num is not None and start is None):\n raise RedisError(\"``start`` and ``num`` must both be specified\")\n\n pieces = [name]\n if by is not None:\n pieces.append(Token('BY'))\n pieces.append(by)\n if start is not None and num is not None:\n pieces.append(Token('LIMIT'))\n pieces.append(start)\n pieces.append(num)\n if get is not None:\n # If get is a string assume we want to get a single value.\n # Otherwise assume it's an interable and we want to get multiple\n # values. We can't just iterate blindly because strings are\n # iterable.\n if isinstance(get, basestring):\n pieces.append(Token('GET'))\n pieces.append(get)\n else:\n for g in get:\n pieces.append(Token('GET'))\n pieces.append(g)\n if desc:\n pieces.append(Token('DESC'))\n if alpha:\n pieces.append(Token('ALPHA'))\n if store is not None:\n pieces.append(Token('STORE'))\n pieces.append(store)\n\n if groups:\n if not get or isinstance(get, basestring) or len(get) < 2:\n raise DataError('when using \"groups\" the \"get\" argument '\n 'must be specified and contain at least '\n 'two keys')\n\n options = {'groups': len(get) if groups else None}\n return self.execute_command('SORT', *pieces, **options)", "metadata": "root.StrictRedis.sort", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1287 }, { "content": " def scan(self, cursor=0, match=None, count=None):\n \"\"\"\n Incrementally return lists of key names. Also return a cursor\n indicating the scan position.\n\n ``match`` allows for filtering the keys by pattern\n\n ``count`` allows for hint the minimum number of returns\n \"\"\"\n pieces = [cursor]\n if match is not None:\n pieces.extend([Token('MATCH'), match])\n if count is not None:\n pieces.extend([Token('COUNT'), count])\n return self.execute_command('SCAN', *pieces)", "metadata": "root.StrictRedis.scan", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1355 }, { "content": " def scan_iter(self, match=None, count=None):\n \"\"\"\n Make an iterator using the SCAN command so that the client doesn't\n need to remember the cursor position.\n\n ``match`` allows for filtering the keys by pattern\n\n ``count`` allows for hint the minimum number of returns\n \"\"\"\n cursor = '0'\n while cursor != 0:\n cursor, data = self.scan(cursor=cursor, match=match, count=count)\n for item in data:\n yield item", "metadata": "root.StrictRedis.scan_iter", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1371 }, { "content": " def sscan(self, name, cursor=0, match=None, count=None):\n \"\"\"\n Incrementally return lists of elements in a set. Also return a cursor\n indicating the scan position.\n\n ``match`` allows for filtering the keys by pattern\n\n ``count`` allows for hint the minimum number of returns\n \"\"\"\n pieces = [name, cursor]\n if match is not None:\n pieces.extend([Token('MATCH'), match])\n if count is not None:\n pieces.extend([Token('COUNT'), count])\n return self.execute_command('SSCAN', *pieces)", "metadata": "root.StrictRedis.sscan", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1386 }, { "content": " def sscan_iter(self, name, match=None, count=None):\n \"\"\"\n Make an iterator using the SSCAN command so that the client doesn't\n need to remember the cursor position.\n\n ``match`` allows for filtering the keys by pattern\n\n ``count`` allows for hint the minimum number of returns\n \"\"\"\n cursor = '0'\n while cursor != 0:\n cursor, data = self.sscan(name, cursor=cursor,\n match=match, count=count)\n for item in data:\n yield item", "metadata": "root.StrictRedis.sscan_iter", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1402 }, { "content": " def hscan(self, name, cursor=0, match=None, count=None):\n \"\"\"\n Incrementally return key/value slices in a hash. Also return a cursor\n indicating the scan position.\n\n ``match`` allows for filtering the keys by pattern\n\n ``count`` allows for hint the minimum number of returns\n \"\"\"\n pieces = [name, cursor]\n if match is not None:\n pieces.extend([Token('MATCH'), match])\n if count is not None:\n pieces.extend([Token('COUNT'), count])\n return self.execute_command('HSCAN', *pieces)", "metadata": "root.StrictRedis.hscan", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1418 }, { "content": " def hscan_iter(self, name, match=None, count=None):\n \"\"\"\n Make an iterator using the HSCAN command so that the client doesn't\n need to remember the cursor position.\n\n ``match`` allows for filtering the keys by pattern\n\n ``count`` allows for hint the minimum number of returns\n \"\"\"\n cursor = '0'\n while cursor != 0:\n cursor, data = self.hscan(name, cursor=cursor,\n match=match, count=count)\n for item in data.items():\n yield item", "metadata": "root.StrictRedis.hscan_iter", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1434 }, { "content": " def zscan(self, name, cursor=0, match=None, count=None,\n score_cast_func=float):\n \"\"\"\n Incrementally return lists of elements in a sorted set. Also return a\n cursor indicating the scan position.\n\n ``match`` allows for filtering the keys by pattern\n\n ``count`` allows for hint the minimum number of returns\n\n ``score_cast_func`` a callable used to cast the score return value\n \"\"\"\n pieces = [name, cursor]\n if match is not None:\n pieces.extend([Token('MATCH'), match])\n if count is not None:\n pieces.extend([Token('COUNT'), count])\n options = {'score_cast_func': score_cast_func}\n return self.execute_command('ZSCAN', *pieces, **options)", "metadata": "root.StrictRedis.zscan", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1450 }, { "content": " def zscan_iter(self, name, match=None, count=None,\n score_cast_func=float):\n \"\"\"\n Make an iterator using the ZSCAN command so that the client doesn't\n need to remember the cursor position.\n\n ``match`` allows for filtering the keys by pattern\n\n ``count`` allows for hint the minimum number of returns\n\n ``score_cast_func`` a callable used to cast the score return value\n \"\"\"\n cursor = '0'\n while cursor != 0:\n cursor, data = self.zscan(name, cursor=cursor, match=match,\n count=count,\n score_cast_func=score_cast_func)\n for item in data:\n yield item", "metadata": "root.StrictRedis.zscan_iter", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1470 }, { "content": " def sadd(self, name, *values):\n \"Add ``value(s)`` to set ``name``\"\n return self.execute_command('SADD', name, *values)", "metadata": "root.StrictRedis.sadd", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1491 }, { "content": " def scard(self, name):\n \"Return the number of elements in set ``name``\"\n return self.execute_command('SCARD', name)", "metadata": "root.StrictRedis.scard", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1495 }, { "content": " def sdiff(self, keys, *args):\n \"Return the difference of sets specified by ``keys``\"\n args = list_or_args(keys, args)\n return self.execute_command('SDIFF', *args)", "metadata": "root.StrictRedis.sdiff", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1499 }, { "content": " def sdiffstore(self, dest, keys, *args):\n \"\"\"\n Store the difference of sets specified by ``keys`` into a new\n set named ``dest``. Returns the number of keys in the new set.\n \"\"\"\n args = list_or_args(keys, args)\n return self.execute_command('SDIFFSTORE', dest, *args)", "metadata": "root.StrictRedis.sdiffstore", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1504 }, { "content": " def sinter(self, keys, *args):\n \"Return the intersection of sets specified by ``keys``\"\n args = list_or_args(keys, args)\n return self.execute_command('SINTER', *args)", "metadata": "root.StrictRedis.sinter", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1512 }, { "content": " def sinterstore(self, dest, keys, *args):\n \"\"\"\n Store the intersection of sets specified by ``keys`` into a new\n set named ``dest``. Returns the number of keys in the new set.\n \"\"\"\n args = list_or_args(keys, args)\n return self.execute_command('SINTERSTORE', dest, *args)", "metadata": "root.StrictRedis.sinterstore", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1517 }, { "content": " def sismember(self, name, value):\n \"Return a boolean indicating if ``value`` is a member of set ``name``\"\n return self.execute_command('SISMEMBER', name, value)", "metadata": "root.StrictRedis.sismember", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1525 }, { "content": " def smembers(self, name):\n \"Return all members of the set ``name``\"\n return self.execute_command('SMEMBERS', name)", "metadata": "root.StrictRedis.smembers", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1529 }, { "content": " def smove(self, src, dst, value):\n \"Move ``value`` from set ``src`` to set ``dst`` atomically\"\n return self.execute_command('SMOVE', src, dst, value)", "metadata": "root.StrictRedis.smove", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1533 }, { "content": " def spop(self, name):\n \"Remove and return a random member of set ``name``\"\n return self.execute_command('SPOP', name)", "metadata": "root.StrictRedis.spop", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1537 }, { "content": " def srandmember(self, name, number=None):\n \"\"\"\n If ``number`` is None, returns a random member of set ``name``.\n\n If ``number`` is supplied, returns a list of ``number`` random\n memebers of set ``name``. Note this is only available when running\n Redis 2.6+.\n \"\"\"\n args = number and [number] or []\n return self.execute_command('SRANDMEMBER', name, *args)", "metadata": "root.StrictRedis.srandmember", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1541 }, { "content": " def srem(self, name, *values):\n \"Remove ``values`` from set ``name``\"\n return self.execute_command('SREM', name, *values)", "metadata": "root.StrictRedis.srem", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1552 }, { "content": " def sunion(self, keys, *args):\n \"Return the union of sets specified by ``keys``\"\n args = list_or_args(keys, args)\n return self.execute_command('SUNION', *args)", "metadata": "root.StrictRedis.sunion", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1556 }, { "content": " def sunionstore(self, dest, keys, *args):\n \"\"\"\n Store the union of sets specified by ``keys`` into a new\n set named ``dest``. Returns the number of keys in the new set.\n \"\"\"\n args = list_or_args(keys, args)\n return self.execute_command('SUNIONSTORE', dest, *args)", "metadata": "root.StrictRedis.sunionstore", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1561 }, { "content": " def zadd(self, name, *args, **kwargs):\n \"\"\"\n Set any number of score, element-name pairs to the key ``name``. Pairs\n can be specified in two ways:\n\n As *args, in the form of: score1, name1, score2, name2, ...\n or as **kwargs, in the form of: name1=score1, name2=score2, ...\n\n The following example would add four values to the 'my-key' key:\n redis.zadd('my-key', 1.1, 'name1', 2.2, 'name2', name3=3.3, name4=4.4)\n \"\"\"\n pieces = []\n if args:\n if len(args) % 2 != 0:\n raise RedisError(\"ZADD requires an equal number of \"\n \"values and scores\")\n pieces.extend(args)\n for pair in iteritems(kwargs):\n pieces.append(pair[1])\n pieces.append(pair[0])\n return self.execute_command('ZADD', name, *pieces)", "metadata": "root.StrictRedis.zadd", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1570 }, { "content": " def zcard(self, name):\n \"Return the number of elements in the sorted set ``name``\"\n return self.execute_command('ZCARD', name)", "metadata": "root.StrictRedis.zcard", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1592 }, { "content": " def zcount(self, name, min, max):\n \"\"\"\n Returns the number of elements in the sorted set at key ``name`` with\n a score between ``min`` and ``max``.\n \"\"\"\n return self.execute_command('ZCOUNT', name, min, max)", "metadata": "root.StrictRedis.zcount", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1596 }, { "content": " def zincrby(self, name, value, amount=1):\n \"Increment the score of ``value`` in sorted set ``name`` by ``amount``\"\n return self.execute_command('ZINCRBY', name, amount, value)", "metadata": "root.StrictRedis.zincrby", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1603 }, { "content": " def zinterstore(self, dest, keys, aggregate=None):\n \"\"\"\n Intersect multiple sorted sets specified by ``keys`` into\n a new sorted set, ``dest``. Scores in the destination will be\n aggregated based on the ``aggregate``, or SUM if none is provided.\n \"\"\"\n return self._zaggregate('ZINTERSTORE', dest, keys, aggregate)", "metadata": "root.StrictRedis.zinterstore", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1607 }, { "content": " def zlexcount(self, name, min, max):\n \"\"\"\n Return the number of items in the sorted set ``name`` between the\n lexicographical range ``min`` and ``max``.\n \"\"\"\n return self.execute_command('ZLEXCOUNT', name, min, max)", "metadata": "root.StrictRedis.zlexcount", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1615 }, { "content": " def zrange(self, name, start, end, desc=False, withscores=False,\n score_cast_func=float):\n \"\"\"\n Return a range of values from sorted set ``name`` between\n ``start`` and ``end`` sorted in ascending order.\n\n ``start`` and ``end`` can be negative, indicating the end of the range.\n\n ``desc`` a boolean indicating whether to sort the results descendingly\n\n ``withscores`` indicates to return the scores along with the values.\n The return type is a list of (value, score) pairs\n\n ``score_cast_func`` a callable used to cast the score return value\n \"\"\"\n if desc:\n return self.zrevrange(name, start, end, withscores,\n score_cast_func)\n pieces = ['ZRANGE', name, start, end]\n if withscores:\n pieces.append(Token('WITHSCORES'))\n options = {\n 'withscores': withscores,\n 'score_cast_func': score_cast_func\n }\n return self.execute_command(*pieces, **options)", "metadata": "root.StrictRedis.zrange", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1622 }, { "content": " def zrangebylex(self, name, min, max, start=None, num=None):\n \"\"\"\n Return the lexicographical range of values from sorted set ``name``\n between ``min`` and ``max``.\n\n If ``start`` and ``num`` are specified, then return a slice of the\n range.\n \"\"\"\n if (start is not None and num is None) or \\\n (num is not None and start is None):\n raise RedisError(\"``start`` and ``num`` must both be specified\")\n pieces = ['ZRANGEBYLEX', name, min, max]\n if start is not None and num is not None:\n pieces.extend([Token('LIMIT'), start, num])\n return self.execute_command(*pieces)", "metadata": "root.StrictRedis.zrangebylex", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1649 }, { "content": " def zrevrangebylex(self, name, max, min, start=None, num=None):\n \"\"\"\n Return the reversed lexicographical range of values from sorted set\n ``name`` between ``max`` and ``min``.\n\n If ``start`` and ``num`` are specified, then return a slice of the\n range.\n \"\"\"\n if (start is not None and num is None) or \\\n (num is not None and start is None):\n raise RedisError(\"``start`` and ``num`` must both be specified\")\n pieces = ['ZREVRANGEBYLEX', name, max, min]\n if start is not None and num is not None:\n pieces.extend([Token('LIMIT'), start, num])\n return self.execute_command(*pieces)", "metadata": "root.StrictRedis.zrevrangebylex", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1665 }, { "content": " def zrangebyscore(self, name, min, max, start=None, num=None,\n withscores=False, score_cast_func=float):\n \"\"\"\n Return a range of values from the sorted set ``name`` with scores\n between ``min`` and ``max``.\n\n If ``start`` and ``num`` are specified, then return a slice\n of the range.\n\n ``withscores`` indicates to return the scores along with the values.\n The return type is a list of (value, score) pairs\n\n `score_cast_func`` a callable used to cast the score return value\n \"\"\"\n if (start is not None and num is None) or \\\n (num is not None and start is None):\n raise RedisError(\"``start`` and ``num`` must both be specified\")\n pieces = ['ZRANGEBYSCORE', name, min, max]\n if start is not None and num is not None:\n pieces.extend([Token('LIMIT'), start, num])\n if withscores:\n pieces.append(Token('WITHSCORES'))\n options = {\n 'withscores': withscores,\n 'score_cast_func': score_cast_func\n }\n return self.execute_command(*pieces, **options)", "metadata": "root.StrictRedis.zrangebyscore", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1681 }, { "content": " def zrank(self, name, value):\n \"\"\"\n Returns a 0-based value indicating the rank of ``value`` in sorted set\n ``name``\n \"\"\"\n return self.execute_command('ZRANK', name, value)", "metadata": "root.StrictRedis.zrank", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1709 }, { "content": " def zrem(self, name, *values):\n \"Remove member ``values`` from sorted set ``name``\"\n return self.execute_command('ZREM', name, *values)", "metadata": "root.StrictRedis.zrem", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1716 }, { "content": " def zremrangebylex(self, name, min, max):\n \"\"\"\n Remove all elements in the sorted set ``name`` between the\n lexicographical range specified by ``min`` and ``max``.\n\n Returns the number of elements removed.\n \"\"\"\n return self.execute_command('ZREMRANGEBYLEX', name, min, max)", "metadata": "root.StrictRedis.zremrangebylex", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1720 }, { "content": " def zremrangebyrank(self, name, min, max):\n \"\"\"\n Remove all elements in the sorted set ``name`` with ranks between\n ``min`` and ``max``. Values are 0-based, ordered from smallest score\n to largest. Values can be negative indicating the highest scores.\n Returns the number of elements removed\n \"\"\"\n return self.execute_command('ZREMRANGEBYRANK', name, min, max)", "metadata": "root.StrictRedis.zremrangebyrank", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1729 }, { "content": " def zremrangebyscore(self, name, min, max):\n \"\"\"\n Remove all elements in the sorted set ``name`` with scores\n between ``min`` and ``max``. Returns the number of elements removed.\n \"\"\"\n return self.execute_command('ZREMRANGEBYSCORE', name, min, max)", "metadata": "root.StrictRedis.zremrangebyscore", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1738 }, { "content": " def zrevrange(self, name, start, end, withscores=False,\n score_cast_func=float):\n \"\"\"\n Return a range of values from sorted set ``name`` between\n ``start`` and ``end`` sorted in descending order.\n\n ``start`` and ``end`` can be negative, indicating the end of the range.\n\n ``withscores`` indicates to return the scores along with the values\n The return type is a list of (value, score) pairs\n\n ``score_cast_func`` a callable used to cast the score return value\n \"\"\"\n pieces = ['ZREVRANGE', name, start, end]\n if withscores:\n pieces.append(Token('WITHSCORES'))\n options = {\n 'withscores': withscores,\n 'score_cast_func': score_cast_func\n }\n return self.execute_command(*pieces, **options)", "metadata": "root.StrictRedis.zrevrange", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1745 }, { "content": " def zrevrangebyscore(self, name, max, min, start=None, num=None,\n withscores=False, score_cast_func=float):\n \"\"\"\n Return a range of values from the sorted set ``name`` with scores\n between ``min`` and ``max`` in descending order.\n\n If ``start`` and ``num`` are specified, then return a slice\n of the range.\n\n ``withscores`` indicates to return the scores along with the values.\n The return type is a list of (value, score) pairs\n\n ``score_cast_func`` a callable used to cast the score return value\n \"\"\"\n if (start is not None and num is None) or \\\n (num is not None and start is None):\n raise RedisError(\"``start`` and ``num`` must both be specified\")\n pieces = ['ZREVRANGEBYSCORE', name, max, min]\n if start is not None and num is not None:\n pieces.extend([Token('LIMIT'), start, num])\n if withscores:\n pieces.append(Token('WITHSCORES'))\n options = {\n 'withscores': withscores,\n 'score_cast_func': score_cast_func\n }\n return self.execute_command(*pieces, **options)", "metadata": "root.StrictRedis.zrevrangebyscore", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1767 }, { "content": " def zrevrank(self, name, value):\n \"\"\"\n Returns a 0-based value indicating the descending rank of\n ``value`` in sorted set ``name``\n \"\"\"\n return self.execute_command('ZREVRANK', name, value)", "metadata": "root.StrictRedis.zrevrank", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1795 }, { "content": " def zscore(self, name, value):\n \"Return the score of element ``value`` in sorted set ``name``\"\n return self.execute_command('ZSCORE', name, value)", "metadata": "root.StrictRedis.zscore", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1802 }, { "content": " def zunionstore(self, dest, keys, aggregate=None):\n \"\"\"\n Union multiple sorted sets specified by ``keys`` into\n a new sorted set, ``dest``. Scores in the destination will be\n aggregated based on the ``aggregate``, or SUM if none is provided.\n \"\"\"\n return self._zaggregate('ZUNIONSTORE', dest, keys, aggregate)", "metadata": "root.StrictRedis.zunionstore", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1806 }, { "content": " def _zaggregate(self, command, dest, keys, aggregate=None):\n pieces = [command, dest, len(keys)]\n if isinstance(keys, dict):\n keys, weights = iterkeys(keys), itervalues(keys)\n else:\n weights = None\n pieces.extend(keys)\n if weights:\n pieces.append(Token('WEIGHTS'))\n pieces.extend(weights)\n if aggregate:\n pieces.append(Token('AGGREGATE'))\n pieces.append(aggregate)\n return self.execute_command(*pieces)", "metadata": "root.StrictRedis._zaggregate", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1814 }, { "content": " def pfadd(self, name, *values):\n \"Adds the specified elements to the specified HyperLogLog.\"\n return self.execute_command('PFADD', name, *values)", "metadata": "root.StrictRedis.pfadd", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1830 }, { "content": " def pfcount(self, *sources):\n \"\"\"\n Return the approximated cardinality of\n the set observed by the HyperLogLog at key(s).\n \"\"\"\n return self.execute_command('PFCOUNT', *sources)", "metadata": "root.StrictRedis.pfcount", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1834 }, { "content": " def pfmerge(self, dest, *sources):\n \"Merge N different HyperLogLogs into a single one.\"\n return self.execute_command('PFMERGE', dest, *sources)", "metadata": "root.StrictRedis.pfmerge", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1841 }, { "content": " def hdel(self, name, *keys):\n \"Delete ``keys`` from hash ``name``\"\n return self.execute_command('HDEL', name, *keys)", "metadata": "root.StrictRedis.hdel", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1846 }, { "content": " def hexists(self, name, key):\n \"Returns a boolean indicating if ``key`` exists within hash ``name``\"\n return self.execute_command('HEXISTS', name, key)", "metadata": "root.StrictRedis.hexists", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1850 }, { "content": " def hget(self, name, key):\n \"Return the value of ``key`` within the hash ``name``\"\n return self.execute_command('HGET', name, key)", "metadata": "root.StrictRedis.hget", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1854 }, { "content": " def hgetall(self, name):\n \"Return a Python dict of the hash's name/value pairs\"\n return self.execute_command('HGETALL', name)", "metadata": "root.StrictRedis.hgetall", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1858 }, { "content": " def hincrby(self, name, key, amount=1):\n \"Increment the value of ``key`` in hash ``name`` by ``amount``\"\n return self.execute_command('HINCRBY', name, key, amount)", "metadata": "root.StrictRedis.hincrby", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1862 }, { "content": " def hincrbyfloat(self, name, key, amount=1.0):\n \"\"\"\n Increment the value of ``key`` in hash ``name`` by floating ``amount``\n \"\"\"\n return self.execute_command('HINCRBYFLOAT', name, key, amount)", "metadata": "root.StrictRedis.hincrbyfloat", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1866 }, { "content": " def hkeys(self, name):\n \"Return the list of keys within hash ``name``\"\n return self.execute_command('HKEYS', name)", "metadata": "root.StrictRedis.hkeys", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1872 }, { "content": " def hlen(self, name):\n \"Return the number of elements in hash ``name``\"\n return self.execute_command('HLEN', name)", "metadata": "root.StrictRedis.hlen", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1876 }, { "content": " def hset(self, name, key, value):\n \"\"\"\n Set ``key`` to ``value`` within hash ``name``\n Returns 1 if HSET created a new field, otherwise 0\n \"\"\"\n return self.execute_command('HSET', name, key, value)", "metadata": "root.StrictRedis.hset", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1880 }, { "content": " def hsetnx(self, name, key, value):\n \"\"\"\n Set ``key`` to ``value`` within hash ``name`` if ``key`` does not\n exist. Returns 1 if HSETNX created a field, otherwise 0.\n \"\"\"\n return self.execute_command('HSETNX', name, key, value)", "metadata": "root.StrictRedis.hsetnx", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1887 }, { "content": " def hmset(self, name, mapping):\n \"\"\"\n Set key to value within hash ``name`` for each corresponding\n key and value from the ``mapping`` dict.\n \"\"\"\n if not mapping:\n raise DataError(\"'hmset' with 'mapping' of length 0\")\n items = []\n for pair in iteritems(mapping):\n items.extend(pair)\n return self.execute_command('HMSET', name, *items)", "metadata": "root.StrictRedis.hmset", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1894 }, { "content": " def hmget(self, name, keys, *args):\n \"Returns a list of values ordered identically to ``keys``\"\n args = list_or_args(keys, args)\n return self.execute_command('HMGET', name, *args)", "metadata": "root.StrictRedis.hmget", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1906 }, { "content": " def hvals(self, name):\n \"Return the list of values within hash ``name``\"\n return self.execute_command('HVALS', name)", "metadata": "root.StrictRedis.hvals", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1911 }, { "content": " def publish(self, channel, message):\n \"\"\"\n Publish ``message`` on ``channel``.\n Returns the number of subscribers the message was delivered to.\n \"\"\"\n return self.execute_command('PUBLISH', channel, message)", "metadata": "root.StrictRedis.publish", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1915 }, { "content": " def eval(self, script, numkeys, *keys_and_args):\n \"\"\"\n Execute the Lua ``script``, specifying the ``numkeys`` the script\n will touch and the key names and argument values in ``keys_and_args``.\n Returns the result of the script.\n\n In practice, use the object returned by ``register_script``. This\n function exists purely for Redis API completion.\n \"\"\"\n return self.execute_command('EVAL', script, numkeys, *keys_and_args)", "metadata": "root.StrictRedis.eval", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1922 }, { "content": " def evalsha(self, sha, numkeys, *keys_and_args):\n \"\"\"\n Use the ``sha`` to execute a Lua script already registered via EVAL\n or SCRIPT LOAD. Specify the ``numkeys`` the script will touch and the\n key names and argument values in ``keys_and_args``. Returns the result\n of the script.\n\n In practice, use the object returned by ``register_script``. This\n function exists purely for Redis API completion.\n \"\"\"\n return self.execute_command('EVALSHA', sha, numkeys, *keys_and_args)", "metadata": "root.StrictRedis.evalsha", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1933 }, { "content": " def script_exists(self, *args):\n \"\"\"\n Check if a script exists in the script cache by specifying the SHAs of\n each script as ``args``. Returns a list of boolean values indicating if\n if each already script exists in the cache.\n \"\"\"\n return self.execute_command('SCRIPT EXISTS', *args)", "metadata": "root.StrictRedis.script_exists", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1945 }, { "content": " def script_flush(self):\n \"Flush all scripts from the script cache\"\n return self.execute_command('SCRIPT FLUSH')", "metadata": "root.StrictRedis.script_flush", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1953 }, { "content": " def script_kill(self):\n \"Kill the currently executing Lua script\"\n return self.execute_command('SCRIPT KILL')", "metadata": "root.StrictRedis.script_kill", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1957 }, { "content": " def script_load(self, script):\n \"Load a Lua ``script`` into the script cache. Returns the SHA.\"\n return self.execute_command('SCRIPT LOAD', script)", "metadata": "root.StrictRedis.script_load", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1961 }, { "content": " def register_script(self, script):\n \"\"\"\n Register a Lua ``script`` specifying the ``keys`` it will touch.\n Returns a Script object that is callable and hides the complexity of\n deal with scripts, keys, and shas. This is the preferred way to work\n with Lua scripts.\n \"\"\"\n return Script(self, script)", "metadata": "root.StrictRedis.register_script", "header": "['class', 'StrictRedis', '(', 'object', ')', ':', '___EOS___']", "index": 1965 }, { "content": "class Redis(StrictRedis):\n \"\"\"\n Provides backwards compatibility with older versions of redis-py that\n changed arguments to some commands to be more Pythonic, sane, or by\n accident.\n \"\"\"\n\n # Overridden callbacks\n RESPONSE_CALLBACKS = dict_merge(\n StrictRedis.RESPONSE_CALLBACKS,\n {\n 'TTL': lambda r: r >= 0 and r or None,\n 'PTTL': lambda r: r >= 0 and r or None,\n }\n )\n\n\n\n", "metadata": "root.Redis", "header": "['module', '___EOS___']", "index": 1975 }, { "content": " def pipeline(self, transaction=True, shard_hint=None):\n \"\"\"\n Return a new pipeline object that can queue multiple commands for\n later execution. ``transaction`` indicates whether all commands\n should be executed atomically. Apart from making a group of operations\n atomic, pipelines are useful for reducing the back-and-forth overhead\n between the client and server.\n \"\"\"\n return Pipeline(\n self.connection_pool,\n self.response_callbacks,\n transaction,\n shard_hint)", "metadata": "root.Redis.pipeline", "header": "['class', 'Redis', '(', 'StrictRedis', ')', ':', '___EOS___']", "index": 1991 }, { "content": " def setex(self, name, value, time):\n \"\"\"\n Set the value of key ``name`` to ``value`` that expires in ``time``\n seconds. ``time`` can be represented by an integer or a Python\n timedelta object.\n \"\"\"\n if isinstance(time, datetime.timedelta):\n time = time.seconds + time.days * 24 * 3600\n return self.execute_command('SETEX', name, time, value)", "metadata": "root.Redis.setex", "header": "['class', 'Redis', '(', 'StrictRedis', ')', ':', '___EOS___']", "index": 2005 }, { "content": " def lrem(self, name, value, num=0):\n \"\"\"\n Remove the first ``num`` occurrences of elements equal to ``value``\n from the list stored at ``name``.\n\n The ``num`` argument influences the operation in the following ways:\n num > 0: Remove elements equal to value moving from head to tail.\n num < 0: Remove elements equal to value moving from tail to head.\n num = 0: Remove all elements equal to value.\n \"\"\"\n return self.execute_command('LREM', name, num, value)", "metadata": "root.Redis.lrem", "header": "['class', 'Redis', '(', 'StrictRedis', ')', ':', '___EOS___']", "index": 2015 }, { "content": " def zadd(self, name, *args, **kwargs):\n \"\"\"\n NOTE: The order of arguments differs from that of the official ZADD\n command. For backwards compatability, this method accepts arguments\n in the form of name1, score1, name2, score2, while the official Redis\n documents expects score1, name1, score2, name2.\n\n If you're looking to use the standard syntax, consider using the\n StrictRedis class. See the API Reference section of the docs for more\n information.\n\n Set any number of element-name, score pairs to the key ``name``. Pairs\n can be specified in two ways:\n\n As *args, in the form of: name1, score1, name2, score2, ...\n or as **kwargs, in the form of: name1=score1, name2=score2, ...\n\n The following example would add four values to the 'my-key' key:\n redis.zadd('my-key', 'name1', 1.1, 'name2', 2.2, name3=3.3, name4=4.4)\n \"\"\"\n pieces = []\n if args:\n if len(args) % 2 != 0:\n raise RedisError(\"ZADD requires an equal number of \"\n \"values and scores\")\n pieces.extend(reversed(args))\n for pair in iteritems(kwargs):\n pieces.append(pair[1])\n pieces.append(pair[0])\n return self.execute_command('ZADD', name, *pieces)", "metadata": "root.Redis.zadd", "header": "['class', 'Redis', '(', 'StrictRedis', ')', ':', '___EOS___']", "index": 2027 }, { "content": "class BasePipeline(object):\n \"\"\"\n Pipelines provide a way to transmit multiple commands to the Redis server\n in one transmission. This is convenient for batch processing, such as\n saving all the values in a list to Redis.\n\n All commands executed within a pipeline are wrapped with MULTI and EXEC\n calls. This guarantees all commands executed in the pipeline will be\n executed atomically.\n\n Any command raising an exception does *not* halt the execution of\n subsequent commands in the pipeline. Instead, the exception is caught\n and its instance is placed into the response list returned by execute().\n Code iterating over the response list should be able to deal with an\n instance of an exception as a potential value. In general, these will be\n ResponseError exceptions, such as those raised when issuing a command\n on a key of a different datatype.\n \"\"\"\n\n UNWATCH_COMMANDS = set(('DISCARD', 'EXEC', 'UNWATCH'))\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.BasePipeline", "header": "['module', '___EOS___']", "index": 2356 }, { "content": " def __init__(self, connection_pool, response_callbacks, transaction,\n shard_hint):\n self.connection_pool = connection_pool\n self.connection = None\n self.response_callbacks = response_callbacks\n self.transaction = transaction\n self.shard_hint = shard_hint\n\n self.watching = False\n self.reset()", "metadata": "root.BasePipeline.__init__", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2377 }, { "content": " def __enter__(self):\n return self", "metadata": "root.BasePipeline.__enter__", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2388 }, { "content": " def __exit__(self, exc_type, exc_value, traceback):\n self.reset()", "metadata": "root.BasePipeline.__exit__", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2391 }, { "content": " def __del__(self):\n try:\n self.reset()\n except Exception:\n pass", "metadata": "root.BasePipeline.__del__", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2394 }, { "content": " def __len__(self):\n return len(self.command_stack)", "metadata": "root.BasePipeline.__len__", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2400 }, { "content": " def reset(self):\n self.command_stack = []\n self.scripts = set()\n # make sure to reset the connection state in the event that we were\n # watching something\n if self.watching and self.connection:\n try:\n # call this manually since our unwatch or\n # immediate_execute_command methods can call reset()\n self.connection.send_command('UNWATCH')\n self.connection.read_response()\n except ConnectionError:\n # disconnect will also remove any previous WATCHes\n self.connection.disconnect()\n # clean up the other instance attributes\n self.watching = False\n self.explicit_transaction = False\n # we can safely return the connection to the pool here since we're\n # sure we're no longer WATCHing anything\n if self.connection:\n self.connection_pool.release(self.connection)\n self.connection = None", "metadata": "root.BasePipeline.reset", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2403 }, { "content": " def multi(self):\n \"\"\"\n Start a transactional block of the pipeline after WATCH commands\n are issued. End the transactional block with `execute`.\n \"\"\"\n if self.explicit_transaction:\n raise RedisError('Cannot issue nested calls to MULTI')\n if self.command_stack:\n raise RedisError('Commands without an initial WATCH have already '\n 'been issued')\n self.explicit_transaction = True", "metadata": "root.BasePipeline.multi", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2426 }, { "content": " def execute_command(self, *args, **kwargs):\n if (self.watching or args[0] == 'WATCH') and \\\n not self.explicit_transaction:\n return self.immediate_execute_command(*args, **kwargs)\n return self.pipeline_execute_command(*args, **kwargs)", "metadata": "root.BasePipeline.execute_command", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2438 }, { "content": " def immediate_execute_command(self, *args, **options):\n \"\"\"\n Execute a command immediately, but don't auto-retry on a\n ConnectionError if we're already WATCHing a variable. Used when\n issuing WATCH or subsequent commands retrieving their values but before\n MULTI is called.\n \"\"\"\n command_name = args[0]\n conn = self.connection\n # if this is the first call, we need a connection\n if not conn:\n conn = self.connection_pool.get_connection(command_name,\n self.shard_hint)\n self.connection = conn\n try:\n conn.send_command(*args)\n return self.parse_response(conn, command_name, **options)\n except (ConnectionError, TimeoutError) as e:\n conn.disconnect()\n if not conn.retry_on_timeout and isinstance(e, TimeoutError):\n raise\n # if we're not already watching, we can safely retry the command\n try:\n if not self.watching:\n conn.send_command(*args)\n return self.parse_response(conn, command_name, **options)\n except ConnectionError:\n # the retry failed so cleanup.\n conn.disconnect()\n self.reset()\n raise", "metadata": "root.BasePipeline.immediate_execute_command", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2444 }, { "content": " def pipeline_execute_command(self, *args, **options):\n \"\"\"\n Stage a command to be executed when execute() is next called\n\n Returns the current Pipeline object back so commands can be\n chained together, such as:\n\n pipe = pipe.set('foo', 'bar').incr('baz').decr('bang')\n\n At some other point, you can then run: pipe.execute(),\n which will execute all commands queued in the pipe.\n \"\"\"\n self.command_stack.append((args, options))\n return self", "metadata": "root.BasePipeline.pipeline_execute_command", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2476 }, { "content": " def _execute_transaction(self, connection, commands, raise_on_error):\n cmds = chain([(('MULTI', ), {})], commands, [(('EXEC', ), {})])\n all_cmds = connection.pack_commands([args for args, _ in cmds])\n connection.send_packed_command(all_cmds)\n errors = []\n\n # parse off the response for MULTI\n # NOTE: we need to handle ResponseErrors here and continue\n # so that we read all the additional command messages from\n # the socket\n try:\n self.parse_response(connection, '_')\n except ResponseError:\n errors.append((0, sys.exc_info()[1]))\n\n # and all the other commands\n for i, command in enumerate(commands):\n try:\n self.parse_response(connection, '_')\n except ResponseError:\n ex = sys.exc_info()[1]\n self.annotate_exception(ex, i + 1, command[0])\n errors.append((i, ex))\n\n # parse the EXEC.\n try:\n response = self.parse_response(connection, '_')\n except ExecAbortError:\n if self.explicit_transaction:\n self.immediate_execute_command('DISCARD')\n if errors:\n raise errors[0][1]\n raise sys.exc_info()[1]\n\n if response is None:\n raise WatchError(\"Watched variable changed.\")\n\n # put any parse errors into the response\n for i, e in errors:\n response.insert(i, e)\n\n if len(response) != len(commands):\n self.connection.disconnect()\n raise ResponseError(\"Wrong number of response items from \"\n \"pipeline execution\")\n\n # find any errors in the response and raise if necessary\n if raise_on_error:\n self.raise_first_error(commands, response)\n\n # We have to run response callbacks manually\n data = []\n for r, cmd in izip(response, commands):\n if not isinstance(r, Exception):\n args, options = cmd\n command_name = args[0]\n if command_name in self.response_callbacks:\n r = self.response_callbacks[command_name](r, **options)\n data.append(r)\n return data", "metadata": "root.BasePipeline._execute_transaction", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2491 }, { "content": " def _execute_pipeline(self, connection, commands, raise_on_error):\n # build up all commands into a single request to increase network perf\n all_cmds = connection.pack_commands([args for args, _ in commands])\n connection.send_packed_command(all_cmds)\n\n response = []\n for args, options in commands:\n try:\n response.append(\n self.parse_response(connection, args[0], **options))\n except ResponseError:\n response.append(sys.exc_info()[1])\n\n if raise_on_error:\n self.raise_first_error(commands, response)\n return response", "metadata": "root.BasePipeline._execute_pipeline", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2552 }, { "content": " def raise_first_error(self, commands, response):\n for i, r in enumerate(response):\n if isinstance(r, ResponseError):\n self.annotate_exception(r, i + 1, commands[i][0])\n raise r", "metadata": "root.BasePipeline.raise_first_error", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2569 }, { "content": " def annotate_exception(self, exception, number, command):\n cmd = safe_unicode(' ').join(imap(safe_unicode, command))\n msg = unicode('Command # %d (%s) of pipeline caused error: %s') % (\n number, cmd, safe_unicode(exception.args[0]))\n exception.args = (msg,) + exception.args[1:]", "metadata": "root.BasePipeline.annotate_exception", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2575 }, { "content": " def parse_response(self, connection, command_name, **options):\n result = StrictRedis.parse_response(\n self, connection, command_name, **options)\n if command_name in self.UNWATCH_COMMANDS:\n self.watching = False\n elif command_name == 'WATCH':\n self.watching = True\n return result", "metadata": "root.BasePipeline.parse_response", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2581 }, { "content": " def load_scripts(self):\n # make sure all scripts that are about to be run on this pipeline exist\n scripts = list(self.scripts)\n immediate = self.immediate_execute_command\n shas = [s.sha for s in scripts]\n # we can't use the normal script_* methods because they would just\n # get buffered in the pipeline.\n exists = immediate('SCRIPT', 'EXISTS', *shas, **{'parse': 'EXISTS'})\n if not all(exists):\n for s, exist in izip(scripts, exists):\n if not exist:\n s.sha = immediate('SCRIPT', 'LOAD', s.script,\n **{'parse': 'LOAD'})", "metadata": "root.BasePipeline.load_scripts", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2590 }, { "content": " def execute(self, raise_on_error=True):\n \"Execute all the commands in the current pipeline\"\n stack = self.command_stack\n if not stack:\n return []\n if self.scripts:\n self.load_scripts()\n if self.transaction or self.explicit_transaction:\n execute = self._execute_transaction\n else:\n execute = self._execute_pipeline\n\n conn = self.connection\n if not conn:\n conn = self.connection_pool.get_connection('MULTI',\n self.shard_hint)\n # assign to self.connection so reset() releases the connection\n # back to the pool after we're done\n self.connection = conn\n\n try:\n return execute(conn, stack, raise_on_error)\n except (ConnectionError, TimeoutError) as e:\n conn.disconnect()\n if not conn.retry_on_timeout and isinstance(e, TimeoutError):\n raise\n # if we were watching a variable, the watch is no longer valid\n # since this connection has died. raise a WatchError, which\n # indicates the user should retry his transaction. If this is more\n # than a temporary failure, the WATCH that the user next issues\n # will fail, propegating the real ConnectionError\n if self.watching:\n raise WatchError(\"A ConnectionError occured on while watching \"\n \"one or more keys\")\n # otherwise, it's safe to retry since the transaction isn't\n # predicated on any state\n return execute(conn, stack, raise_on_error)\n finally:\n self.reset()", "metadata": "root.BasePipeline.execute", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2604 }, { "content": " def watch(self, *names):\n \"Watches the values at keys ``names``\"\n if self.explicit_transaction:\n raise RedisError('Cannot issue a WATCH after a MULTI')\n return self.execute_command('WATCH', *names)", "metadata": "root.BasePipeline.watch", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2644 }, { "content": " def unwatch(self):\n \"Unwatches all previously specified keys\"\n return self.watching and self.execute_command('UNWATCH') or True", "metadata": "root.BasePipeline.unwatch", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2650 }, { "content": " def script_load_for_pipeline(self, script):\n \"Make sure scripts are loaded prior to pipeline execution\"\n # we need the sha now so that Script.__call__ can use it to run\n # evalsha.\n if not script.sha:\n script.sha = self.immediate_execute_command('SCRIPT', 'LOAD',\n script.script,\n **{'parse': 'LOAD'})\n self.scripts.add(script)", "metadata": "root.BasePipeline.script_load_for_pipeline", "header": "['class', 'BasePipeline', '(', 'object', ')', ':', '___EOS___']", "index": 2654 }, { "content": "class StrictPipeline(BasePipeline, StrictRedis):\n \"Pipeline for the StrictRedis class\"\n pass", "metadata": "root.StrictPipeline", "header": "['module', '___EOS___']", "index": 2665 }, { "content": "class Pipeline(BasePipeline, Redis):\n \"Pipeline for the Redis class\"\n pass", "metadata": "root.Pipeline", "header": "['module', '___EOS___']", "index": 2670 } ]
[ { "span": "class StrictPipeline(BasePipeline, StrictRedis):", "start_line": 2665, "start_column": 0, "end_line": 2665, "end_column": 48 }, { "span": "class Pipeline(BasePipeline, Redis):", "start_line": 2670, "start_column": 0, "end_line": 2670, "end_column": 36 } ]
[ { "span": "def execute_command(self, *args, **options):", "start_line": 565, "start_column": 4, "end_line": 565, "end_column": 48 }, { "span": "def parse_response(self, connection, command_name, **options):", "start_line": 582, "start_column": 4, "end_line": 582, "end_column": 66 }, { "span": "def watch(self, *names):", "start_line": 1130, "start_column": 4, "end_line": 1130, "end_column": 28 }, { "span": "def unwatch(self):", "start_line": 1136, "start_column": 4, "end_line": 1136, "end_column": 22 }, { "span": "def execute_command(self, *args, **kwargs):", "start_line": 2438, "start_column": 4, "end_line": 2438, "end_column": 47 }, { "span": "def parse_response(self, connection, command_name, **options):", "start_line": 2581, "start_column": 4, "end_line": 2581, "end_column": 66 }, { "span": "def watch(self, *names):", "start_line": 2644, "start_column": 4, "end_line": 2644, "end_column": 28 }, { "span": "def unwatch(self):", "start_line": 2650, "start_column": 4, "end_line": 2650, "end_column": 22 } ]
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_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Implementation", " ", "of", " ", "the", " ", "Red", "is", " ", "protoc", "ol", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "abstract", " ", "class", " ", "provide", "s", " ", "a", " ", "Pyth", "on", " ", "interface", " ", "to", " ", "all", " ", "Red", "is", " ", "command", "s", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "an", " ", "implementation", " ", "of", " ", "the", " ", "Red", "is", " ", "protoc", "ol", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Connect", "ion", " ", "and", " ", "Pipe", "line", " ", "derive", " ", "from", " ", "this", ",", " ", "implement", "ing", " ", "how", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "command", "s", " ", "are", " ", "sent", " ", "and", " ", "receive", "d", " ", "to", " ", "the", " ", "Red", "is", " ", "server", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RESPONSE", "\\u", "CALL", "BACK", "S_", "=_", "dict", "\\u", "merge_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "string", "\\u", "keys", "\\u", "to", "\\u", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "AUTH", " ", "EXIST", "S", " ", "EXPIRE", " ", "EXPIRE", "AT", " ", "HEX", "IST", "S", " ", "HM", "SET", " ", "MOVE", " ", "MSE", "TN", "X", " ", "PERS", "IST", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PSE", "TEX", " ", "RENA", "MEN", "X", " ", "SIS", "MEMBER", " ", "SMO", "VE", " ", "SET", "EX", " ", "SET", "NX", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bool_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "string", "\\u", "keys", "\\u", "to", "\\u", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "BIT", "COUNT", " ", "BIT", "POS", " ", "DEC", "RB", "Y", " ", "DEL", " ", "GET", "BIT", " ", "HD", "EL", " ", "HL", "EN", " ", "INC", "RB", "Y", " ", "LIN", "SER", "T", " ", "LLE", "N", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "LP", "US", "HX", " ", "PF", "ADD", " ", "PF", "COUNT", " ", "RP", "US", "HX", " ", "SA", "DD", " ", "SCA", "RD", " ", "SD", "IF", "FS", "TOR", "E", " ", "SET", "BIT", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SET", "RANGE", " ", "SIN", "TER", "STORE", " ", "SRE", "M", " ", "STR", "LEN", " ", "SUN", "IONS", "TOR", "E", " ", "ZA", "DD", " ", "ZC", "ARD", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ZL", "EXC", "OUN", "T", " ", "ZR", "EM", " ", "ZR", "EM", "RANGE", "BY", "LEX", " ", "ZR", "EM", "RANGE", "BY", "RANK", " ", "ZR", "EM", "RANGE", "BY", "SCORE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "int_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "string", "\\u", "keys", "\\u", "to", "\\u", "dict_", "(_", "'", "INC", "RB", "YF", "LO", "AT", " ", "HI", "NC", "RB", "YF", "LO", "AT", "'_", ",_", "float_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "string", "\\u", "keys", "\\u", "to", "\\u", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "these", " ", "return", " ", "OK", ",", " ", "or", " ", "int", " ", "if", " ", "redis", "-", "server", " ", "is", " ", ">=", "1.3", ".4_", "\\u\\u\\uNL\\u\\u\\u_", "'", "LP", "US", "H", " ", "RP", "US", "H", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "r_", ":_", "isinstance_", "(_", "r_", ",_", "long_", ")_", "and_", "r_", "or_", "nativ", "estr", "_", "(_", "r_", ")_", "==_", "'", "OK", "'_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "string", "\\u", "keys", "\\u", "to", "\\u", "dict_", "(_", "'", "SORT", "'_", ",_", "sort", "\\u", "return", "\\u", "tuples_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "string", "\\u", "keys", "\\u", "to", "\\u", "dict_", "(_", "'", "ZS", "CORE", " ", "ZI", "NC", "RB", "Y", "'_", ",_", "float", "\\u", "or", "\\u", "none_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "string", "\\u", "keys", "\\u", "to", "\\u", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "FLU", "SHA", "LL", " ", "FLU", "SH", "DB", " ", "LS", "ET", " ", "LT", "RI", "M", " ", "MSE", "T", " ", "PF", "MERGE", " ", "RENA", "ME", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SAVE", " ", "SELECT", " ", "SHUTDOWN", " ", "SLA", "VE", "OF", " ", "WATCH", " ", "UN", "WATCH", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "bool\\u", "ok_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "string", "\\u", "keys", "\\u", "to", "\\u", "dict_", "(_", "'", "BL", "POP", " ", "BR", "POP", "'_", ",_", "lambda_", "r_", ":_", "r_", "and_", "tuple_", "(_", "r_", ")_", "or_", "None_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "string", "\\u", "keys", "\\u", "to", "\\u", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SD", "IF", "F", " ", "SIN", "TER", " ", "SM", "EM", "BER", "S", " ", "SUN", "ION", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lambda_", "r_", ":_", "r_", "and_", "set_", "(_", "r_", ")_", "or_", "set_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "string", "\\u", "keys", "\\u", "to", "\\u", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ZR", "ANGE", " ", "ZR", "ANGE", "BY", "SCORE", " ", "ZR", "EV", "RANGE", " ", "ZR", "EV", "RANGE", "BY", "SCORE", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "zs", "et", "\\u", "score", "\\u", "pairs_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "string", "\\u", "keys", "\\u", "to", "\\u", "dict_", "(_", "'", "ZR", "AN", "K", " ", "ZR", "EV", "RANK", "'_", ",_", "int\\u", "or", "\\u", "none_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "string", "\\u", "keys", "\\u", "to", "\\u", "dict_", "(_", "'", "BG", "RE", "WRITE", "AO", "F", " ", "BG", "SAVE", "'_", ",_", "lambda_", "r_", ":_", "True_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "CLIENT", " ", "GET", "NAME", "'_", ":_", "lambda_", "r_", ":_", "r_", "and_", "nativ", "estr", "_", "(_", "r_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "CLIENT", " ", "KILL", "'_", ":_", "bool\\u", "ok_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "CLIENT", " ", "LIST", "'_", ":_", "parse", "\\u", "client", "\\u", "list_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "CLIENT", " ", "SET", "NAME", "'_", ":_", "bool\\u", "ok_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "CONFIG", " ", "GET", "'_", ":_", "parse", "\\u", "config", "\\u", "get_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "CONFIG", " ", "RESE", "TST", "AT", "'_", ":_", "bool\\u", "ok_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "CONFIG", " ", "SET", "'_", ":_", "bool\\u", "ok_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "DEBU", "G", " ", "OBJ", "ECT", "'_", ":_", "parse", "\\u", "debug", "\\u", "object_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "HG", "ETA", "LL", "'_", ":_", "lambda_", "r_", ":_", "r_", "and_", "pair", "s", "\\u", "to", "\\u", "dict_", "(_", "r_", ")_", "or_", "{_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "HS", "CAN", "'_", ":_", "parse", "\\u", "hsc", "an_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "INFO", "'_", ":_", "parse", "\\u", "info_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "LAS", "TS", "AV", "E", "'_", ":_", "timestamp", "\\u", "to", "\\u", "datetime_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "OBJ", "ECT", "'_", ":_", "parse", "\\u", "object_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PING", "'_", ":_", "lambda_", "r_", ":_", "nativ", "estr", "_", "(_", "r_", ")_", "==_", "'", "PON", "G", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "RANDOM", "KEY", "'_", ":_", "lambda_", "r_", ":_", "r_", "and_", "r_", "or_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SCAN", "'_", ":_", "parse", "\\u", "scan_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SCRIPT", " ", "EXIST", "S", "'_", ":_", "lambda_", "r_", ":_", "list_", "(_", "imap_", "(_", "bool_", ",_", "r_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SCRIPT", " ", "FLU", "SH", "'_", ":_", "bool\\u", "ok_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SCRIPT", " ", "KILL", "'_", ":_", "bool\\u", "ok_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SCRIPT", " ", "LOAD", "'_", ":_", "nativ", "estr", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SENT", "INE", "L", " ", "GET", "-", "MASTER", "-", "ADDR", "-", "BY", "-", "NAME", "'_", ":_", "parse", "\\u", "sentinel", "\\u", "get", "\\u", "master_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SENT", "INE", "L", " ", "MASTER", "'_", ":_", "parse", "\\u", "sentinel", "\\u", "master_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SENT", "INE", "L", " ", "MASTER", "S", "'_", ":_", "parse", "\\u", "sentinel", "\\u", "masters_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SENT", "INE", "L", " ", "MONITOR", "'_", ":_", "bool\\u", "ok_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SENT", "INE", "L", " ", "REMOVE", "'_", ":_", "bool\\u", "ok_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SENT", "INE", "L", " ", "SENT", "INE", "LS", "'_", ":_", "parse", "\\u", "sentinel", "\\u", "slaves", "\\u", "and", "\\u", "sentinel", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SENT", "INE", "L", " ", "SET", "'_", ":_", "bool\\u", "ok_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SENT", "INE", "L", " ", "SLA", "VE", "S", "'_", ":_", "parse", "\\u", "sentinel", "\\u", "slaves", "\\u", "and", "\\u", "sentinel", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SET", "'_", ":_", "lambda_", "r_", ":_", "r_", "and_", "nativ", "estr", "_", "(_", "r_", ")_", "==_", "'", "OK", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SLO", "WL", "OG", " ", "GET", "'_", ":_", "parse", "\\u", "slow", "log", "\\u", "get_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SLO", "WL", "OG", " ", "LEN", "'_", ":_", "int_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SLO", "WL", "OG", " ", "RESE", "T", "'_", ":_", "bool\\u", "ok_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "SS", "CAN", "'_", ":_", "parse", "\\u", "scan_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TIME", "'_", ":_", "lambda_", "x_", ":_", "(_", "int_", "(_", "x_", "[_", "0_", "]_", ")_", ",_", "int_", "(_", "x_", "[_", "1_", "]_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ZS", "CAN", "'_", ":_", "parse", "\\u", "zsc", "an_", "\\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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "COMMA", "ND", " ", "EXECUT", "ION", " ", "AND", " ", "PROTOCOL", " ", "PAR", "SIN", "G_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SERVER", " ", "INFORMATION", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "BASIC", " ", "KEY", " ", "COMMANDS_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u", "contains\\u\\u_", "=_", "exists_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\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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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "LIST", " ", "COMMANDS_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SCAN", " ", "COMMANDS_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SET", " ", "COMMANDS_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "SORT", "ED", " ", "SET", " ", "COMMANDS_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "HYP", "ER", "LOG", "LOG", " ", "COMMANDS_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "HAS", "H", " ", "COMMANDS_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "@_", "classmethod_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "from", "\\u", "url_", "(_", "cls_", ",_", "url_", ",_", "db_", "=_", "None_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "Red", "is", " ", "client", " ", "object", " ", "configur", "ed", " ", "from", " ", "the", " ", "give", "n", " ", "URL", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "For", " ", "example", "::", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "redis", "://", "[:", "password", "]", "@", "local", "host", ":", "6379", "/", "0", "\\", "10", ";", " ", " ", " ", " ", "unix", "://", "[:", "password", "]", "@", "/", "path", "/", "to", "/", "socket", ".", "sock", "?", "db", "=", "0", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "There", " ", "are", " ", "sever", "al", " ", "way", "s", " ", "to", " ", "speci", "fy", " ", "a", " ", "databa", "se", " ", "number", ".", " ", "The", " ", "parse", " ", "function", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "return", " ", "the", " ", "first", " ", "specified", " ", "option", ":", "\\", "10", ";", " ", " ", " ", " ", "1", ".", " ", "A", " ", "``", "db", "``", " ", "querystring", " ", "option", ",", " ", "e", ".", "g", ".", " ", "redis", "://", "local", "host", "?", "db", "=", "0", "\\", "10", ";", " ", " ", " ", " ", "2", ".", " ", "If", " ", "usi", "ng", " ", "the", " ", "redis", "://", " ", "sche", "me", ",", " ", "the", " ", "path", " ", "argu", "ment", " ", "of", " ", "the", " ", "url", ",", " ", "e", ".", "g", ".", "\\", "10", ";", " ", " ", " ", "redis", "://", "local", "host", "/", "0", "\\", "10", ";", " ", " ", " ", " ", "3", ".", " ", "The", " ", "``", "db", "``", " ", "argu", "ment", " ", "to", " ", "this", " ", "function", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "none", " ", "of", " ", "these", " ", "options", " ", "are", " ", "specified", ",", " ", "db", "=", "0", " ", "is", " ", "used", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Any", " ", "addition", "al", " ", "querystring", " ", "argu", "ment", "s", " ", "and", " ", "keyw", "ord", " ", "argu", "ment", "s", " ", "will", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "pass", "ed", " ", "along", " ", "to", " ", "the", " ", "Connect", "ion", "Poo", "l", " ", "class", "'", "s", " ", "initializer", ".", " ", "In", " ", "the", " ", "case", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "conflicting", " ", "argu", "ment", "s", ",", " ", "querystring", " ", "argu", "ment", "s", " ", "alw", "ay", "s", " ", "win", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connecti", "on", "\\u", "pool_", "=_", "Connect", "ion", "Pool_", "._", "from", "\\u", "url_", "(_", "url_", ",_", "db_", "=_", "db_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cls_", "(_", "connecti", "on", "\\u", "pool_", "=_", "connecti", "on", "\\u", "pool_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "host_", "=_", "'", "local", "host", "'_", ",_", "port_", "=_", "6379", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "db_", "=_", "0_", ",_", "password_", "=_", "None_", ",_", "socket", "\\u", "timeout_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "socket", "\\u", "connect", "\\u", "timeout_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "socket", "\\u", "keepalive", "_", "=_", "None_", ",_", "socket", "\\u", "keepalive", "\\u", "options_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "connecti", "on", "\\u", "pool_", "=_", "None_", ",_", "unix", "\\u", "socket", "\\u", "path_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "encoding_", "=_", "'", "utf", "-", "8", "'_", ",_", "encoding", "\\u", "errors_", "=_", "'", "strict", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "charset_", "=_", "None_", ",_", "errors_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "decode", "\\u", "responses_", "=_", "False_", ",_", "retr", "y", "\\u", "on", "\\u", "timeout_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ssl_", "=_", "False_", ",_", "ssl", "\\u", "keyfile_", "=_", "None_", ",_", "ssl", "\\u", "certfile", "_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ssl", "\\u", "cert", "\\u", "reqs_", "=_", "None_", ",_", "ssl", "\\u", "ca", "\\u", "certs_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "connections_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "connecti", "on", "\\u", "pool_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "charset_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "warn_", "(_", "Dep", "reca", "tion", "Warning_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "charset", "\"", " ", "is", " ", "depre", "cated", ".", " ", "Us", "e", " ", "\"", "encoding", "\"", " ", "inst", "ead", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoding_", "=_", "charset_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "errors_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "warnings_", "._", "warn_", "(_", "Dep", "reca", "tion", "Warning_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'\"", "error", "s", "\"", " ", "is", " ", "depre", "cated", ".", " ", "Us", "e", " ", "\"", "encoding", "\\u", "error", "s", "\"", " ", "inst", "ead", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "encoding", "\\u", "errors_", "=_", "errors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwargs_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "db", "'_", ":_", "db_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "password", "'_", ":_", "password_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "socket", "\\u", "timeo", "ut", "'_", ":_", "socket", "\\u", "timeout_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "encoding", "'_", ":_", "encoding_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "encoding", "\\u", "error", "s", "'_", ":_", "encoding", "\\u", "errors_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "decode", "\\u", "response", "s", "'_", ":_", "decode", "\\u", "responses_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "retr", "y", "\\u", "on", "\\u", "timeo", "ut", "'_", ":_", "retr", "y", "\\u", "on", "\\u", "timeout_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "max", "\\u", "connections", "'_", ":_", "max", "\\u", "connections_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "based", " ", "on", " ", "input", ",", " ", "setup", " ", "appropr", "iate", " ", "connecti", "on", " ", "args_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "unix", "\\u", "socket", "\\u", "path_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "path", "'_", ":_", "unix", "\\u", "socket", "\\u", "path_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "connecti", "on", "\\u", "class", "'_", ":_", "Uni", "x", "Doma", "in", "Sock", "et", "Connection_", "\\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_", "#", " ", "TC", "P", " ", "specific", " ", "options_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "kwargs_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "host", "'_", ":_", "host_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "port", "'_", ":_", "port_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "socket", "\\u", "connect", "\\u", "timeo", "ut", "'_", ":_", "socket", "\\u", "connect", "\\u", "timeout_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "socket", "\\u", "keepalive", "'_", ":_", "socket", "\\u", "keepalive", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "socket", "\\u", "keepalive", "\\u", "options", "'_", ":_", "socket", "\\u", "keepalive", "\\u", "options_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ssl_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "kwargs_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "connecti", "on", "\\u", "class", "'_", ":_", "SS", "LC", "onnect", "ion_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ssl", "\\u", "keyfile", "'_", ":_", "ssl", "\\u", "keyfile_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ssl", "\\u", "certfile", "'_", ":_", "ssl", "\\u", "certfile", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ssl", "\\u", "cert", "\\u", "reqs", "'_", ":_", "ssl", "\\u", "cert", "\\u", "reqs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ssl", "\\u", "ca", "\\u", "cert", "s", "'_", ":_", "ssl", "\\u", "ca", "\\u", "certs_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "connecti", "on", "\\u", "pool_", "=_", "Connect", "ion", "Pool_", "(_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "connecti", "on", "\\u", "pool_", "=_", "connecti", "on", "\\u", "pool_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "use", "\\u", "lua", "\\u", "lock_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "response", "\\u", "callbacks_", "=_", "self_", "._", "\\u\\u", "class\\u\\u_", "._", "RESPONSE", "\\u", "CALL", "BACK", "S_", "._", "copy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "repr\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"%", "s", "<", "%", "s", ">\"_", "%_", "(_", "type_", "(_", "self_", ")_", "._", "\\u\\u", "name\\u\\u_", ",_", "repr_", "(_", "self_", "._", "connecti", "on", "\\u", "pool_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set\\u", "response", "\\u", "callback_", "(_", "self_", ",_", "command_", ",_", "callback_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Set", " ", "a", " ", "custom", " ", "Respons", "e", " ", "Call", "back", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "response", "\\u", "callbacks_", "[_", "command_", "]_", "=_", "callback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pipeline_", "(_", "self_", ",_", "transaction_", "=_", "True_", ",_", "shard", "\\u", "hint_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "new", " ", "pipeline", " ", "object", " ", "tha", "t", " ", "can", " ", "queue", " ", "multiple", " ", "command", "s", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "late", "r", " ", "executi", "on", ".", " ", "``", "transaction", "``", " ", "indicat", "es", " ", "whe", "ther", " ", "all", " ", "command", "s", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "be", " ", "executed", " ", "atomi", "call", "y", ".", " ", "Ap", "art", " ", "from", " ", "mak", "ing", " ", "a", " ", "group", " ", "of", " ", "operati", "ons", "\\", "10", ";", " ", " ", " ", " ", "atomi", "c", ",", " ", "pipeline", "s", " ", "are", " ", "usef", "ul", " ", "for", " ", "reduc", "ing", " ", "the", " ", "back", "-", "and", "-", "fort", "h", " ", "overhead", "\\", "10", ";", " ", " ", " ", " ", "bet", "ween", " ", "the", " ", "client", " ", "and", " ", "server", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Stri", "ct", "Pipeline_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "connecti", "on", "\\u", "pool_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "response", "\\u", "callbacks_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "transaction_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shard", "\\u", "hint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "transaction_", "(_", "self_", ",_", "func_", ",_", "*_", "watch", "es_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Conve", "nie", "nce", " ", "method", " ", "for", " ", "executi", "ng", " ", "the", " ", "calla", "ble", " ", "`", "func", "`", " ", "as", " ", "a", " ", "transaction", "\\", "10", ";", " ", " ", " ", " ", "whi", "le", " ", "watch", "ing", " ", "all", " ", "keys", " ", "specified", " ", "in", " ", "`", "watch", "es", "`.", " ", "The", " ", "'", "func", "'", " ", "calla", "ble", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "expect", " ", "a", " ", "single", " ", "argu", "ment", " ", "whi", "ch", " ", "is", " ", "a", " ", "Pipe", "line", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shard", "\\u", "hint_", "=_", "kwargs_", "._", "pop_", "(_", "'", "shard", "\\u", "hin", "t", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value", "\\u", "from", "\\u", "callable_", "=_", "kwargs_", "._", "pop_", "(_", "'", "value", "\\u", "from", "\\u", "calla", "ble", "'_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "watch", "\\u", "delay_", "=_", "kwargs_", "._", "pop_", "(_", "'", "watch", "\\u", "dela", "y", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "self_", "._", "pipeline_", "(_", "True_", ",_", "shard", "\\u", "hint_", ")_", "as_", "pipe_", ":_", "\\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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "watch", "es_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "pipe_", "._", "watch_", "(_", "*_", "watch", "es_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "func", "\\u", "value_", "=_", "func_", "(_", "pipe_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exec", "\\u", "value_", "=_", "pipe_", "._", "execute_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "func", "\\u", "value_", "if_", "value", "\\u", "from", "\\u", "callable_", "else_", "exec", "\\u", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Watch", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "watch", "\\u", "delay_", "is_", "not_", "None_", "and_", "watch", "\\u", "delay_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "time_", "._", "sleep_", "(_", "watch", "\\u", "delay_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "lock_", "(_", "self_", ",_", "name_", ",_", "timeout_", "=_", "None_", ",_", "sleep_", "=_", "0.1_", ",_", "blockin", "g", "\\u", "timeout_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "lock", "\\u", "class_", "=_", "None_", ",_", "thread", "\\u", "local_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "new", " ", "Lock", " ", "object", " ", "usi", "ng", " ", "key", " ", "``", "name", "``", " ", "tha", "t", " ", "mimic", "s", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "behavior", " ", "of", " ", "thread", "ing", ".", "Lock", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "specified", ",", " ", "``", "timeo", "ut", "``", " ", "indicat", "es", " ", "a", " ", "maxim", "um", " ", "life", " ", "for", " ", "the", " ", "lock", ".", "\\", "10", ";", " ", " ", " ", " ", "By", " ", "default", ",", " ", "it", " ", "will", " ", "rema", "in", " ", "lock", "ed", " ", "unti", "l", " ", "release", "()", " ", "is", " ", "call", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "sleep", "``", " ", "indicat", "es", " ", "the", " ", "amo", "unt", " ", "of", " ", "time", " ", "to", " ", "sleep", " ", "per", " ", "loop", " ", "iterati", "on", "\\", "10", ";", " ", " ", " ", " ", "whe", "n", " ", "the", " ", "lock", " ", "is", " ", "in", " ", "blockin", "g", " ", "mode", " ", "and", " ", "anot", "her", " ", "client", " ", "is", " ", "currentl", "y", "\\", "10", ";", " ", " ", " ", " ", "holding", " ", "the", " ", "lock", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "blockin", "g", "\\u", "timeo", "ut", "``", " ", "indicat", "es", " ", "the", " ", "maxim", "um", " ", "amo", "unt", " ", "of", " ", "time", " ", "in", " ", "second", "s", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "spend", " ", "try", "ing", " ", "to", " ", "acquir", "e", " ", "the", " ", "lock", ".", " ", "A", " ", "value", " ", "of", " ", "``", "Non", "e", "``", " ", "indicat", "es", "\\", "10", ";", " ", " ", " ", " ", "continue", " ", "try", "ing", " ", "forever", ".", " ", "``", "blockin", "g", "\\u", "timeo", "ut", "``", " ", "can", " ", "be", " ", "specified", " ", "as", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "float", " ", "or", " ", "integ", "er", ",", " ", "bot", "h", " ", "represent", "ing", " ", "the", " ", "number", " ", "of", " ", "second", "s", " ", "to", " ", "wait", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "lock", "\\u", "class", "``", " ", "force", "s", " ", "the", " ", "specified", " ", "lock", " ", "implementation", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "thread", "\\u", "local", "``", " ", "indicat", "es", " ", "whe", "ther", " ", "the", " ", "lock", " ", "token", " ", "is", " ", "place", "d", " ", "in", "\\", "10", ";", " ", " ", " ", " ", "thread", "-", "local", " ", "storage", ".", " ", "By", " ", "default", ",", " ", "the", " ", "token", " ", "is", " ", "place", "d", " ", "in", " ", "thread", " ", "local", "\\", "10", ";", " ", " ", " ", " ", "storage", " ", "so", " ", "tha", "t", " ", "a", " ", "thread", " ", "only", " ", "see", "s", " ", "its", " ", "token", ",", " ", "not", " ", "a", " ", "token", " ", "set", " ", "by", "\\", "10", ";", " ", " ", " ", " ", "anot", "her", " ", "thread", ".", " ", "Consider", " ", "the", " ", "follow", "ing", " ", "timeline", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "time", ":", " ", "0", ",", " ", "thread", "-1", " ", "acquir", "es", " ", "`", "my", "-", "lock", "`", ",", " ", "with", " ", "a", " ", "timeo", "ut", " ", "of", " ", "5", " ", "second", "s", ".", "\\", "10", ";", " ", " ", " ", "thread", "-1", " ", "sets", " ", "the", " ", "token", " ", "to", " ", "\"", "abc", "\"", "\\", "10", ";", " ", " ", " ", " ", "time", ":", " ", "1", ",", " ", "thread", "-", "2", " ", "blocks", " ", "try", "ing", " ", "to", " ", "acquir", "e", " ", "`", "my", "-", "lock", "`", " ", "usi", "ng", " ", "the", "\\", "10", ";", " ", " ", " ", "Lock", " ", "instance", ".", "\\", "10", ";", " ", " ", " ", " ", "time", ":", " ", "5", ",", " ", "thread", "-1", " ", "has", " ", "not", " ", "ye", "t", " ", "complete", "d", ".", " ", "redis", " ", "expir", "es", " ", "the", " ", "lock", "\\", "10", ";", " ", " ", " ", "key", ".", "\\", "10", ";", " ", " ", " ", " ", "time", ":", " ", "5", ",", " ", "thread", "-", "2", " ", "acquired", " ", "`", "my", "-", "lock", "`", " ", "now", " ", "tha", "t", " ", "it", "'", "s", " ", "avail", "able", ".", "\\", "10", ";", " ", " ", " ", "thread", "-", "2", " ", "sets", " ", "the", " ", "token", " ", "to", " ", "\"", "xyz", "\"", "\\", "10", ";", " ", " ", " ", " ", "time", ":", " ", "6", ",", " ", "thread", "-1", " ", "finish", "es", " ", "its", " ", "work", " ", "and", " ", "calls", " ", "release", "()", ".", " ", "if", " ", "the", "\\", "10", ";", " ", " ", " ", "token", " ", "is", " ", "*", "not", "*", " ", "store", "d", " ", "in", " ", "thread", " ", "local", " ", "storage", ",", " ", "then", "\\", "10", ";", " ", " ", " ", "thread", "-1", " ", "wou", "ld", " ", "see", " ", "the", " ", "token", " ", "value", " ", "as", " ", "\"", "xyz", "\"", " ", "and", " ", "wou", "ld", " ", "be", "\\", "10", ";", " ", " ", " ", "able", " ", "to", " ", "success", "full", "y", " ", "release", " ", "the", " ", "thread", "-", "2", "'", "s", " ", "lock", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "In", " ", "some", " ", "use", " ", "case", "s", " ", "it", "'", "s", " ", "necessar", "y", " ", "to", " ", "disable", " ", "thread", " ", "local", " ", "storage", ".", " ", "For", "\\", "10", ";", " ", " ", " ", " ", "example", ",", " ", "if", " ", "you", " ", "have", " ", "code", " ", "where", " ", "one", " ", "thread", " ", "acquir", "es", " ", "a", " ", "lock", " ", "and", " ", "pass", "es", "\\", "10", ";", " ", " ", " ", " ", "tha", "t", " ", "lock", " ", "instance", " ", "to", " ", "a", " ", "worker", " ", "thread", " ", "to", " ", "release", " ", "late", "r", ".", " ", "If", " ", "thread", "\\", "10", ";", " ", " ", " ", " ", "local", " ", "storage", " ", "isn", "'", "t", " ", "disable", "d", " ", "in", " ", "this", " ", "case", ",", " ", "the", " ", "worker", " ", "thread", " ", "won", "'", "t", " ", "see", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "token", " ", "set", " ", "by", " ", "the", " ", "thread", " ", "tha", "t", " ", "acquired", " ", "the", " ", "lock", ".", " ", "Ou", "r", " ", "assumption", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "tha", "t", " ", "these", " ", "case", "s", " ", "are", "n", "'", "t", " ", "common", " ", "and", " ", "as", " ", "suc", "h", " ", "default", " ", "to", " ", "usi", "ng", "\\", "10", ";", " ", " ", " ", " ", "thread", " ", "local", " ", "storage", ".", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "lock", "\\u", "class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "\\u", "use", "\\u", "lua", "\\u", "lock_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "first", " ", "time", " ", ".", "lock", "()", " ", "is", " ", "call", "ed", ",", " ", "dete", "rmin", "e", " ", "if", " ", "we", " ", "can", " ", "use_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Lu", "a", " ", "by", " ", "atte", "mpt", "ing", " ", "to", " ", "register", " ", "the", " ", "necessar", "y", " ", "scripts_", "\\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 ", " ", "_", "Lu", "a", "Lock_", "._", "register", "\\u", "scripts_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "use", "\\u", "lua", "\\u", "lock_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Respons", "e", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "\\u", "use", "\\u", "lua", "\\u", "lock_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "lock", "\\u", "class_", "=_", "self_", "._", "\\u", "use", "\\u", "lua", "\\u", "lock_", "and_", "Lu", "a", "Lock_", "or_", "Lock_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "lock", "\\u", "class_", "(_", "self_", ",_", "name_", ",_", "timeout_", "=_", "timeout_", ",_", "sleep_", "=_", "sleep_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "blockin", "g", "\\u", "timeout_", "=_", "blockin", "g", "\\u", "timeout_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "thread", "\\u", "local_", "=_", "thread", "\\u", "local_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pubsub_", "(_", "self_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "Publish", "/", "Subscrib", "e", " ", "object", ".", " ", "With", " ", "this", " ", "object", ",", " ", "you", " ", "can", "\\", "10", ";", " ", " ", " ", " ", "subscribe", " ", "to", " ", "channel", "s", " ", "and", " ", "listen", " ", "for", " ", "message", "s", " ", "tha", "t", " ", "get", " ", "publi", "shed", " ", "to", "\\", "10", ";", " ", " ", " ", " ", "them", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Pub", "Sub_", "(_", "self_", "._", "connecti", "on", "\\u", "pool_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute", "\\u", "command_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Execut", "e", " ", "a", " ", "command", " ", "and", " ", "return", " ", "a", " ", "parsed", " ", "response", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pool_", "=_", "self_", "._", "connecti", "on", "\\u", "pool_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "command", "\\u", "name_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connection_", "=_", "pool_", "._", "get", "\\u", "connection_", "(_", "command", "\\u", "name_", ",_", "**_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "._", "send", "\\u", "command_", "(_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "parse", "\\u", "response_", "(_", "connection_", ",_", "command", "\\u", "name_", ",_", "**_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Connect", "ion", "Error_", ",_", "Time", "out", "Error_", ")_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "._", "disconnect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "connection_", "._", "retr", "y", "\\u", "on", "\\u", "timeout_", "and_", "isinstance_", "(_", "e_", ",_", "Time", "out", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "connection_", "._", "send", "\\u", "command_", "(_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "parse", "\\u", "response_", "(_", "connection_", ",_", "command", "\\u", "name_", ",_", "**_", "options_", ")_", "\\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 ", " _", "pool_", "._", "release_", "(_", "connection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "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_", "parse", "\\u", "response_", "(_", "self_", ",_", "connection_", ",_", "command", "\\u", "name_", ",_", "**_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Pars", "es", " ", "a", " ", "response", " ", "from", " ", "the", " ", "Red", "is", " ", "server", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "response_", "=_", "connection_", "._", "read", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "command", "\\u", "name_", "in_", "self_", "._", "response", "\\u", "callbacks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "response", "\\u", "callbacks_", "[_", "command", "\\u", "name_", "]_", "(_", "response_", ",_", "**_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bgr", "ew", "rite", "ao", "f_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Tell", " ", "the", " ", "Red", "is", " ", "server", " ", "to", " ", "rewrite", " ", "the", " ", "AO", "F", " ", "file", " ", "from", " ", "data", " ", "in", " ", "memory", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "BG", "RE", "WRITE", "AO", "F", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bg", "save_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Tell", " ", "the", " ", "Red", "is", " ", "server", " ", "to", " ", "save", " ", "its", " ", "data", " ", "to", " ", "disk", ".", " ", " ", "Unli", "ke", " ", "save", "()", ",", "\\", "10", ";", " ", " ", " ", " ", "this", " ", "method", " ", "is", " ", "async", "hronous", " ", "and", " ", "return", "s", " ", "immediate", "ly", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "BG", "SAVE", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "client", "\\u", "kill_", "(_", "self_", ",_", "address_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Disconnect", "s", " ", "the", " ", "client", " ", "at", " ", "``", "address", "``", " ", "(", "ip", ":", "port", ")\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "CLIENT", " ", "KILL", "'_", ",_", "address_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "client", "\\u", "list_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "a", " ", "list", " ", "of", " ", "currentl", "y", " ", "connect", "ed", " ", "clients", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "CLIENT", " ", "LIST", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "client", "\\u", "getn", "ame_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "the", " ", "current", " ", "connecti", "on", " ", "name", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "CLIENT", " ", "GET", "NAME", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "client", "\\u", "setn", "ame_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Set", "s", " ", "the", " ", "current", " ", "connecti", "on", " ", "name", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "CLIENT", " ", "SET", "NAME", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "config", "\\u", "get_", "(_", "self_", ",_", "pattern_", "=_", "\"*\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "a", " ", "dictionar", "y", " ", "of", " ", "configura", "tion", " ", "based", " ", "on", " ", "the", " ", "``", "pattern", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "CONFIG", " ", "GET", "'_", ",_", "pattern_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "config", "\\u", "set_", "(_", "self_", ",_", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Set", " ", "config", " ", "item", " ", "``", "name", "``", " ", "with", " ", "``", "value", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "CONFIG", " ", "SET", "'_", ",_", "name_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "config", "\\u", "reset", "stat_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Reset", " ", "runt", "ime", " ", "statistic", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "CONFIG", " ", "RESE", "TST", "AT", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "config", "\\u", "rewrite", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Rewrite", " ", "config", " ", "file", " ", "with", " ", "the", " ", "minima", "l", " ", "change", " ", "to", " ", "reflect", " ", "runn", "ing", " ", "config", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "CONFIG", " ", "RE", "WRITE", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dbs", "ize_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "the", " ", "number", " ", "of", " ", "keys", " ", "in", " ", "the", " ", "current", " ", "databa", "se", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "DB", "SIZE", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "debug", "\\u", "object_", "(_", "self_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "version", " ", "specific", " ", "meta", " ", "informati", "on", " ", "abo", "ut", " ", "a", " ", "give", "n", " ", "key", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "DEBU", "G", " ", "OBJ", "ECT", "'_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "echo_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Ech", "o", " ", "the", " ", "string", " ", "back", " ", "from", " ", "the", " ", "server", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "ECHO", "'_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "flush", "all_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Delete", " ", "all", " ", "keys", " ", "in", " ", "all", " ", "databa", "ses", " ", "on", " ", "the", " ", "current", " ", "host", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "FLU", "SHA", "LL", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "flush", "db_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Delete", " ", "all", " ", "keys", " ", "in", " ", "the", " ", "current", " ", "databa", "se", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "FLU", "SH", "DB", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "info_", "(_", "self_", ",_", "section_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "dictionar", "y", " ", "contain", "ing", " ", "informati", "on", " ", "abo", "ut", " ", "the", " ", "Red", "is", " ", "server", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "``", "section", "``", " ", "option", " ", "can", " ", "be", " ", "used", " ", "to", " ", "select", " ", "a", " ", "specific", " ", "section", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "informati", "on", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "section", " ", "option", " ", "is", " ", "not", " ", "support", "ed", " ", "by", " ", "older", " ", "version", "s", " ", "of", " ", "Red", "is", " ", "Server", ",", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "will", " ", "generat", "e", " ", "Respons", "e", "Error", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "section_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "INFO", "'_", ")_", "\\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_", "._", "execute", "\\u", "command_", "(_", "'", "INFO", "'_", ",_", "section_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "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_", "lasts", "ave_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "Pyth", "on", " ", "datetime", " ", "object", " ", "represent", "ing", " ", "the", " ", "last", " ", "time", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "Red", "is", " ", "databa", "se", " ", "was", " ", "saved", " ", "to", " ", "disk", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "LAS", "TS", "AV", "E", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "object_", "(_", "self_", ",_", "info", "type_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "the", " ", "encoding", ",", " ", "idle", "time", ",", " ", "or", " ", "refco", "unt", " ", "abo", "ut", " ", "the", " ", "key", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "OBJ", "ECT", "'_", ",_", "info", "type_", ",_", "key_", ",_", "info", "type_", "=_", "info", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ping_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Ping", " ", "the", " ", "Red", "is", " ", "server", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "PING", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "save_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Tell", " ", "the", " ", "Red", "is", " ", "server", " ", "to", " ", "save", " ", "its", " ", "data", " ", "to", " ", "disk", ",", "\\", "10", ";", " ", " ", " ", " ", "blockin", "g", " ", "unti", "l", " ", "the", " ", "save", " ", "is", " ", "complete", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SAVE", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sentinel_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Red", "is", " ", "Senti", "nel", "'", "s", " ", "SENT", "INE", "L", " ", "command", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warnings_", "._", "warn_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Dep", "reca", "tion", "Warning_", "(_", "'", "Us", "e", " ", "the", " ", "individual", " ", "sentinel", "\\u*", " ", "method", "s", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sentinel", "\\u", "get", "\\u", "master", "\\u", "addr", "\\u", "by", "\\u", "name_", "(_", "self_", ",_", "service", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "a", " ", "(", "host", ",", " ", "port", ")", " ", "pair", " ", "for", " ", "the", " ", "give", "n", " ", "``", "service", "\\u", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SENT", "INE", "L", " ", "GET", "-", "MASTER", "-", "ADDR", "-", "BY", "-", "NAME", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "service", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sentinel", "\\u", "master_", "(_", "self_", ",_", "service", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "a", " ", "dictionar", "y", " ", "contain", "ing", " ", "the", " ", "specified", " ", "master", "s", " ", "state", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SENT", "INE", "L", " ", "MASTER", "'_", ",_", "service", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sentinel", "\\u", "masters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "a", " ", "list", " ", "of", " ", "dictionar", "ies", " ", "contain", "ing", " ", "each", " ", "master", "'", "s", " ", "state", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SENT", "INE", "L", " ", "MASTER", "S", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sentinel", "\\u", "monitor_", "(_", "self_", ",_", "name_", ",_", "ip_", ",_", "port_", ",_", "quorum", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Add", " ", "a", " ", "new", " ", "master", " ", "to", " ", "Senti", "nel", " ", "to", " ", "be", " ", "monitored", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SENT", "INE", "L", " ", "MONITOR", "'_", ",_", "name_", ",_", "ip_", ",_", "port_", ",_", "quorum", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sentinel", "\\u", "remove_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Remove", " ", "a", " ", "master", " ", "from", " ", "Senti", "nel", "'", "s", " ", "monitorin", "g", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SENT", "INE", "L", " ", "REMOVE", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sentinel", "\\u", "sentinel", "s_", "(_", "self_", ",_", "service", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "a", " ", "list", " ", "of", " ", "sentinel", "s", " ", "for", " ", "``", "service", "\\u", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SENT", "INE", "L", " ", "SENT", "INE", "LS", "'_", ",_", "service", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sentinel", "\\u", "set_", "(_", "self_", ",_", "name_", ",_", "option_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Set", " ", "Senti", "nel", " ", "monitorin", "g", " ", "parameter", "s", " ", "for", " ", "a", " ", "give", "n", " ", "master", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SENT", "INE", "L", " ", "SET", "'_", ",_", "name_", ",_", "option_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sentinel", "\\u", "slaves_", "(_", "self_", ",_", "service", "\\u", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "a", " ", "list", " ", "of", " ", "slaves", " ", "for", " ", "``", "service", "\\u", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SENT", "INE", "L", " ", "SLA", "VE", "S", "'_", ",_", "service", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "shutdown_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Shut", "down", " ", "the", " ", "server", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SHUTDOWN", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Connect", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "a", " ", "Connect", "ion", "Error", " ", "here", " ", "is", " ", "expected_", "\\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_", "Red", "is", "Error_", "(_", "\"", "SHUTDOWN", " ", "see", "ms", " ", "to", " ", "have", " ", "fail", "ed", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "slave", "of_", "(_", "self_", ",_", "host_", "=_", "None_", ",_", "port_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "the", " ", "server", " ", "to", " ", "be", " ", "a", " ", "replicate", "d", " ", "slave", " ", "of", " ", "the", " ", "instance", " ", "identifi", "ed", "\\", "10", ";", " ", " ", " ", " ", "by", " ", "the", " ", "``", "host", "``", " ", "and", " ", "``", "port", "``.", " ", "If", " ", "call", "ed", " ", "with", "out", " ", "argu", "ment", "s", ",", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "instance", " ", "is", " ", "promote", "d", " ", "to", " ", "a", " ", "master", " ", "inst", "ead", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "host_", "is_", "None_", "and_", "port_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SLA", "VE", "OF", "'_", ",_", "Token_", "(_", "'", "NO", "'_", ")_", ",_", "Token_", "(_", "'", "ONE", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SLA", "VE", "OF", "'_", ",_", "host_", ",_", "port_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "slow", "log", "\\u", "get_", "(_", "self_", ",_", "num_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Get", " ", "the", " ", "entri", "es", " ", "from", " ", "the", " ", "slow", "log", ".", " ", "If", " ", "``", "num", "``", " ", "is", " ", "specified", ",", " ", "get", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "most", " ", "recent", " ", "``", "num", "``", " ", "items", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "[_", "'", "SLO", "WL", "OG", " ", "GET", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "num_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", "._", "append_", "(_", "num_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "slow", "log", "\\u", "len_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Get", " ", "the", " ", "number", " ", "of", " ", "items", " ", "in", " ", "the", " ", "slow", "log", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SLO", "WL", "OG", " ", "LEN", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "slow", "log", "\\u", "reset_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Remove", " ", "all", " ", "items", " ", "in", " ", "the", " ", "slow", "log", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SLO", "WL", "OG", " ", "RESE", "T", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "time_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "server", " ", "time", " ", "as", " ", "a", " ", "2", "-", "item", " ", "tuple", " ", "of", " ", "ints", ":", "\\", "10", ";", " ", " ", " ", " ", "(", "second", "s", " ", "sinc", "e", " ", "epoch", ",", " ", "microsecond", "s", " ", "int", "o", " ", "this", " ", "second", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "TIME", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "wait_", "(_", "self_", ",_", "num", "\\u", "replicas_", ",_", "timeout_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Red", "is", " ", "synchron", "ous", " ", "replication", "\\", "10", ";", " ", " ", " ", " ", "Tha", "t", " ", "return", "s", " ", "the", " ", "number", " ", "of", " ", "replica", "s", " ", "tha", "t", " ", "process", "ed", " ", "the", " ", "query", " ", "whe", "n", "\\", "10", ";", " ", " ", " ", " ", "we", " ", "final", "ly", " ", "have", " ", "at", " ", "leas", "t", " ", "``", "num", "\\u", "replica", "s", "``", ",", " ", "or", " ", "whe", "n", " ", "the", " ", "``", "timeo", "ut", "``", " ", "was", "\\", "10", ";", " ", " ", " ", " ", "reache", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "WAIT", "'_", ",_", "num", "\\u", "replicas_", ",_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "append_", "(_", "self_", ",_", "key_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Append", "s", " ", "the", " ", "string", " ", "``", "value", "``", " ", "to", " ", "the", " ", "value", " ", "at", " ", "``", "key", "``.", " ", "If", " ", "``", "key", "``", "\\", "10", ";", " ", " ", " ", " ", "doe", "sn", "'", "t", " ", "alr", "ead", "y", " ", "exist", ",", " ", "create", " ", "it", " ", "with", " ", "a", " ", "value", " ", "of", " ", "``", "value", "``.", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "new", " ", "length", " ", "of", " ", "the", " ", "value", " ", "at", " ", "``", "key", "``.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "APPEN", "D", "'_", ",_", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bit", "count_", "(_", "self_", ",_", "key_", ",_", "start_", "=_", "None_", ",_", "end_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "count", " ", "of", " ", "set", " ", "bits", " ", "in", " ", "the", " ", "value", " ", "of", " ", "``", "key", "``.", " ", " ", "Optio", "nal", "\\", "10", ";", " ", " ", " ", " ", "``", "start", "``", " ", "and", " ", "``", "end", "``", " ", "param", "ater", "s", " ", "indicat", "e", " ", "whi", "ch", " ", "bytes", " ", "to", " ", "consider", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "[_", "key_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "start_", "is_", "not_", "None_", "and_", "end_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "._", "append_", "(_", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "._", "append_", "(_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "(_", "start_", "is_", "not_", "None_", "and_", "end_", "is_", "None_", ")_", "or_", "(_", "end_", "is_", "not_", "None_", "and_", "start_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Red", "is", "Error_", "(_", "\"", "Bot", "h", " ", "start", " ", "and", " ", "end", " ", "must", " ", "be", " ", "specified", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "BIT", "COUNT", "'_", ",_", "*_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bit", "op_", "(_", "self_", ",_", "operation_", ",_", "dest_", ",_", "*_", "keys_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Perform", " ", "a", " ", "bitwise", " ", "operati", "on", " ", "usi", "ng", " ", "``", "operati", "on", "``", " ", "bet", "ween", " ", "``", "keys", "``", " ", "and", "\\", "10", ";", " ", " ", " ", " ", "store", " ", "the", " ", "result", " ", "in", " ", "``", "dest", "``.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "BIT", "OP", "'_", ",_", "operation_", ",_", "dest_", ",_", "*_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bit", "pos_", "(_", "self_", ",_", "key_", ",_", "bit_", ",_", "start_", "=_", "None_", ",_", "end_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "position", " ", "of", " ", "the", " ", "first", " ", "bit", " ", "set", " ", "to", " ", "1", " ", "or", " ", "0", " ", "in", " ", "a", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "``", "start", "``", " ", "and", " ", "``", "end", "``", " ", "difi", "nes", " ", "search", " ", "range", ".", " ", "The", " ", "range", " ", "is", " ", "interprete", "d", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "a", " ", "range", " ", "of", " ", "bytes", " ", "and", " ", "not", " ", "a", " ", "range", " ", "of", " ", "bits", ",", " ", "so", " ", "start", "=", "0", " ", "and", " ", "end", "=", "2", "\\", "10", ";", " ", " ", " ", " ", "means", " ", "to", " ", "look", " ", "at", " ", "the", " ", "first", " ", "three", " ", "bytes", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "bit_", "not_", "in_", "(_", "0_", ",_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Red", "is", "Error_", "(_", "'", "bit", " ", "must", " ", "be", " ", "0", " ", "or", " ", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "params_", "=_", "[_", "key_", ",_", "bit_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "start_", "is_", "not_", "None_", "and_", "params_", "._", "append_", "(_", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "start_", "is_", "not_", "None_", "and_", "end_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "params_", "._", "append_", "(_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "start_", "is_", "None_", "and_", "end_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Red", "is", "Error_", "(_", "\"", "start", " ", "argu", "ment", " ", "is", " ", "not", " ", "set", ",", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "whe", "n", " ", "end", " ", "is", " ", "specified", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "BIT", "POS", "'_", ",_", "*_", "params_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dec", "r_", "(_", "self_", ",_", "name_", ",_", "amount_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Decre", "ment", "s", " ", "the", " ", "value", " ", "of", " ", "``", "key", "``", " ", "by", " ", "``", "amo", "unt", "``.", " ", " ", "If", " ", "no", " ", "key", " ", "exist", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "value", " ", "will", " ", "be", " ", "initialize", "d", " ", "as", " ", "0", " ", "-", " ", "``", "amo", "unt", "``", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "DEC", "RB", "Y", "'_", ",_", "name_", ",_", "amount_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "delete_", "(_", "self_", ",_", "*_", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Delete", " ", "one", " ", "or", " ", "more", " ", "keys", " ", "specified", " ", "by", " ", "``", "names", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "DEL", "'_", ",_", "*_", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "delitem\\u\\u_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "delete_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dump_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "serialize", "d", " ", "version", " ", "of", " ", "the", " ", "value", " ", "store", "d", " ", "at", " ", "the", " ", "specified", " ", "key", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "key", " ", "doe", "s", " ", "not", " ", "exist", " ", "a", " ", "nil", " ", "bul", "k", " ", "repl", "y", " ", "is", " ", "return", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "DUMP", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "exists_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "a", " ", "boolean", " ", "indicati", "ng", " ", "whe", "ther", " ", "key", " ", "``", "name", "``", " ", "exist", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "EXIST", "S", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "expire_", "(_", "self_", ",_", "name_", ",_", "time_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "an", " ", "expir", "e", " ", "flag", " ", "on", " ", "key", " ", "``", "name", "``", " ", "for", " ", "``", "time", "``", " ", "second", "s", ".", " ", "``", "time", "``", "\\", "10", ";", " ", " ", " ", " ", "can", " ", "be", " ", "represent", "ed", " ", "by", " ", "an", " ", "integ", "er", " ", "or", " ", "a", " ", "Pyth", "on", " ", "timedelta", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "time_", ",_", "datetime_", "._", "timedelta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "=_", "time_", "._", "seconds_", "+_", "time_", "._", "days_", "*_", "24_", "*_", "3600_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "EXPIRE", "'_", ",_", "name_", ",_", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "expir", "eat", "_", "(_", "self_", ",_", "name_", ",_", "when_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "an", " ", "expir", "e", " ", "flag", " ", "on", " ", "key", " ", "``", "name", "``.", " ", "``", "whe", "n", "``", " ", "can", " ", "be", " ", "represent", "ed", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "an", " ", "integ", "er", " ", "indicati", "ng", " ", "unix", " ", "time", " ", "or", " ", "a", " ", "Pyth", "on", " ", "datetime", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "when_", ",_", "datetime_", "._", "datetime_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "when_", "=_", "int_", "(_", "mod", "\\u", "time_", "._", "mktime_", "(_", "when_", "._", "timetuple_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "EXPIRE", "AT", "'_", ",_", "name_", ",_", "when_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "value", " ", "at", " ", "key", " ", "``", "name", "``", ",", " ", "or", " ", "Non", "e", " ", "if", " ", "the", " ", "key", " ", "doe", "sn", "'", "t", " ", "exist", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "GET", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "getitem\\u\\u_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "value", " ", "at", " ", "key", " ", "``", "name", "``", ",", " ", "raise", "s", " ", "a", " ", "Key", "Error", " ", "if", " ", "the", " ", "key", "\\", "10", ";", " ", " ", " ", " ", "doe", "sn", "'", "t", " ", "exist", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "self_", "._", "get_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "Key", "Error_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "getb", "it_", "(_", "self_", ",_", "name_", ",_", "offset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "a", " ", "boolean", " ", "indicati", "ng", " ", "the", " ", "value", " ", "of", " ", "``", "offset", "``", " ", "in", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "GET", "BIT", "'_", ",_", "name_", ",_", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "getra", "nge_", "(_", "self_", ",_", "key_", ",_", "start_", ",_", "end_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "substring", " ", "of", " ", "the", " ", "string", " ", "value", " ", "store", "d", " ", "at", " ", "``", "key", "``", ",", "\\", "10", ";", " ", " ", " ", " ", "dete", "rmin", "ed", " ", "by", " ", "the", " ", "offset", "s", " ", "``", "start", "``", " ", "and", " ", "``", "end", "``", " ", "(", "bot", "h", " ", "are", " ", "inclu", "sive", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "GET", "RANGE", "'_", ",_", "key_", ",_", "start_", ",_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "gets", "et_", "(_", "self_", ",_", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", "s", " ", "the", " ", "value", " ", "at", " ", "key", " ", "``", "name", "``", " ", "to", " ", "``", "value", "``", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "return", "s", " ", "the", " ", "old", " ", "value", " ", "at", " ", "key", " ", "``", "name", "``", " ", "atomi", "call", "y", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "GET", "SET", "'_", ",_", "name_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "incr_", "(_", "self_", ",_", "name_", ",_", "amount_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Increment", "s", " ", "the", " ", "value", " ", "of", " ", "``", "key", "``", " ", "by", " ", "``", "amo", "unt", "``.", " ", " ", "If", " ", "no", " ", "key", " ", "exist", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "value", " ", "will", " ", "be", " ", "initialize", "d", " ", "as", " ", "``", "amo", "unt", "``", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "INC", "RB", "Y", "'_", ",_", "name_", ",_", "amount_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "incr", "by_", "(_", "self_", ",_", "name_", ",_", "amount_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Increment", "s", " ", "the", " ", "value", " ", "of", " ", "``", "key", "``", " ", "by", " ", "``", "amo", "unt", "``.", " ", " ", "If", " ", "no", " ", "key", " ", "exist", "s", ",", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "value", " ", "will", " ", "be", " ", "initialize", "d", " ", "as", " ", "``", "amo", "unt", "``", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "An", " ", "alias", " ", "for", " ", "``", "incr", "()``", ",", " ", "bec", "aus", "e", " ", "it", " ", "is", " ", "alr", "ead", "y", " ", "implemented", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "as", " ", "INC", "RB", "Y", " ", "redis", " ", "command", "._", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "incr_", "(_", "name_", ",_", "amount_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "incr", "by", "float_", "(_", "self_", ",_", "name_", ",_", "amount_", "=_", "1.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Increment", "s", " ", "the", " ", "value", " ", "at", " ", "key", " ", "``", "name", "``", " ", "by", " ", "float", "ing", " ", "``", "amo", "unt", "``.", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "no", " ", "key", " ", "exist", "s", ",", " ", "the", " ", "value", " ", "will", " ", "be", " ", "initialize", "d", " ", "as", " ", "``", "amo", "unt", "``", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "INC", "RB", "YF", "LO", "AT", "'_", ",_", "name_", ",_", "amount_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "keys_", "(_", "self_", ",_", "pattern_", "=_", "'*'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "a", " ", "list", " ", "of", " ", "keys", " ", "matchi", "ng", " ", "``", "pattern", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "KEYS", "'_", ",_", "pattern_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mg", "et_", "(_", "self_", ",_", "keys_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "list", " ", "of", " ", "values", " ", "order", "ed", " ", "identi", "call", "y", " ", "to", " ", "``", "keys", "``", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "list", "\\u", "or", "\\u", "args_", "(_", "keys_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "MG", "ET", "'_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mse", "t_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", "s", " ", "key", "/", "values", " ", "based", " ", "on", " ", "a", " ", "mapping", ".", " ", "Map", "ping", " ", "can", " ", "be", " ", "supplie", "d", " ", "as", " ", "a", " ", "single", "\\", "10", ";", " ", " ", " ", " ", "dictionar", "y", " ", "argu", "ment", " ", "or", " ", "as", " ", "kwarg", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "args_", ")_", "!=_", "1_", "or_", "not_", "isinstance_", "(_", "args_", "[_", "0_", "]_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Red", "is", "Error_", "(_", "'", "MSE", "T", " ", "require", "s", " ", "**", "kwarg", "s", " ", "or", " ", "a", " ", "single", " ", "dict", " ", "arg", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwargs_", "._", "update_", "(_", "args_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "items_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pair_", "in_", "iteritems_", "(_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "items_", "._", "extend_", "(_", "pair_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "MSE", "T", "'_", ",_", "*_", "items_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "mse", "tn", "x_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", "s", " ", "key", "/", "values", " ", "based", " ", "on", " ", "a", " ", "mapping", " ", "if", " ", "none", " ", "of", " ", "the", " ", "keys", " ", "are", " ", "alr", "ead", "y", " ", "set", ".", "\\", "10", ";", " ", " ", " ", " ", "Map", "ping", " ", "can", " ", "be", " ", "supplie", "d", " ", "as", " ", "a", " ", "single", " ", "dictionar", "y", " ", "argu", "ment", " ", "or", " ", "as", " ", "kwarg", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "boolean", " ", "indicati", "ng", " ", "if", " ", "the", " ", "operati", "on", " ", "was", " ", "success", "ful", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "args_", ")_", "!=_", "1_", "or_", "not_", "isinstance_", "(_", "args_", "[_", "0_", "]_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Red", "is", "Error_", "(_", "'", "MSE", "TN", "X", " ", "require", "s", " ", "**", "kwarg", "s", " ", "or", " ", "a", " ", "single", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "dict", " ", "arg", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "kwargs_", "._", "update_", "(_", "args_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "items_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pair_", "in_", "iteritems_", "(_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "items_", "._", "extend_", "(_", "pair_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "MSE", "TN", "X", "'_", ",_", "*_", "items_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "move_", "(_", "self_", ",_", "name_", ",_", "db_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Moves", " ", "the", " ", "key", " ", "``", "name", "``", " ", "to", " ", "a", " ", "different", " ", "Red", "is", " ", "databa", "se", " ", "``", "db", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "MOVE", "'_", ",_", "name_", ",_", "db_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "persist_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Remove", "s", " ", "an", " ", "expir", "ation", " ", "on", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "PERS", "IST", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pex", "pir", "e_", "(_", "self_", ",_", "name_", ",_", "time_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "an", " ", "expir", "e", " ", "flag", " ", "on", " ", "key", " ", "``", "name", "``", " ", "for", " ", "``", "time", "``", " ", "milliseconds", ".", "\\", "10", ";", " ", " ", " ", " ", "``", "time", "``", " ", "can", " ", "be", " ", "represent", "ed", " ", "by", " ", "an", " ", "integ", "er", " ", "or", " ", "a", " ", "Pyth", "on", " ", "timedelta", "\\", "10", ";", " ", " ", " ", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "time_", ",_", "datetime_", "._", "timedelta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ms_", "=_", "int_", "(_", "time_", "._", "microseconds_", "/_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time_", "=_", "(_", "time_", "._", "seconds_", "+_", "time_", "._", "days_", "*_", "24_", "*_", "3600_", ")_", "*_", "1000_", "+_", "ms_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "PE", "XP", "IRE", "'_", ",_", "name_", ",_", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pex", "pir", "eat", "_", "(_", "self_", ",_", "name_", ",_", "when_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "an", " ", "expir", "e", " ", "flag", " ", "on", " ", "key", " ", "``", "name", "``.", " ", "``", "whe", "n", "``", " ", "can", " ", "be", " ", "represent", "ed", "\\", "10", ";", " ", " ", " ", " ", "as", " ", "an", " ", "integ", "er", " ", "represent", "ing", " ", "unix", " ", "time", " ", "in", " ", "milliseconds", " ", "(", "unix", " ", "time", " ", "*", " ", "1000", ")", "\\", "10", ";", " ", " ", " ", " ", "or", " ", "a", " ", "Pyth", "on", " ", "datetime", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "when_", ",_", "datetime_", "._", "datetime_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ms_", "=_", "int_", "(_", "when_", "._", "microsecond_", "/_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "when_", "=_", "int_", "(_", "mod", "\\u", "time_", "._", "mktime_", "(_", "when_", "._", "timetuple_", "(_", ")_", ")_", ")_", "*_", "1000_", "+_", "ms_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "PE", "XP", "IRE", "AT", "'_", ",_", "name_", ",_", "when_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pset", "ex_", "(_", "self_", ",_", "name_", ",_", "time", "\\u", "ms_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "the", " ", "value", " ", "of", " ", "key", " ", "``", "name", "``", " ", "to", " ", "``", "value", "``", " ", "tha", "t", " ", "expir", "es", " ", "in", " ", "``", "time", "\\u", "ms", "``", "\\", "10", ";", " ", " ", " ", " ", "milliseconds", ".", " ", "``", "time", "\\u", "ms", "``", " ", "can", " ", "be", " ", "represent", "ed", " ", "by", " ", "an", " ", "integ", "er", " ", "or", " ", "a", " ", "Pyth", "on", "\\", "10", ";", " ", " ", " ", " ", "timedelta", " ", "object", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "time", "\\u", "ms_", ",_", "datetime_", "._", "timedelta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ms_", "=_", "int_", "(_", "time", "\\u", "ms_", "._", "microseconds_", "/_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "time", "\\u", "ms_", "=_", "(_", "time", "\\u", "ms_", "._", "seconds_", "+_", "time", "\\u", "ms_", "._", "days_", "*_", "24_", "*_", "3600_", ")_", "*_", "1000_", "+_", "ms_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "PSE", "TEX", "'_", ",_", "name_", ",_", "time", "\\u", "ms_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pt", "tl_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "the", " ", "number", " ", "of", " ", "milliseconds", " ", "unti", "l", " ", "the", " ", "key", " ", "``", "name", "``", " ", "will", " ", "expir", "e", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "PT", "TL", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "random", "key_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "the", " ", "name", " ", "of", " ", "a", " ", "random", " ", "key", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "RANDOM", "KEY", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rename_", "(_", "self_", ",_", "src_", ",_", "dst_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Rename", " ", "key", " ", "``", "src", "``", " ", "to", " ", "``", "dst", "``", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "RENA", "ME", "'_", ",_", "src_", ",_", "dst_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rename", "nx_", "(_", "self_", ",_", "src_", ",_", "dst_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Rename", " ", "key", " ", "``", "src", "``", " ", "to", " ", "``", "dst", "``", " ", "if", " ", "``", "dst", "``", " ", "doe", "sn", "'", "t", " ", "alr", "ead", "y", " ", "exist", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "RENA", "MEN", "X", "'_", ",_", "src_", ",_", "dst_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "restore_", "(_", "self_", ",_", "name_", ",_", "ttl_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Creat", "e", " ", "a", " ", "key", " ", "usi", "ng", " ", "the", " ", "provided", " ", "serialize", "d", " ", "value", ",", " ", "previ", "ously", " ", "obtain", "ed", "\\", "10", ";", " ", " ", " ", " ", "usi", "ng", " ", "DUMP", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "REST", "ORE", "'_", ",_", "name_", ",_", "ttl_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set_", "(_", "self_", ",_", "name_", ",_", "value_", ",_", "ex_", "=_", "None_", ",_", "px_", "=_", "None_", ",_", "nx_", "=_", "False_", ",_", "xx_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "the", " ", "value", " ", "at", " ", "key", " ", "``", "name", "``", " ", "to", " ", "``", "value", "``", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "ex", "``", " ", "sets", " ", "an", " ", "expir", "e", " ", "flag", " ", "on", " ", "key", " ", "``", "name", "``", " ", "for", " ", "``", "ex", "``", " ", "second", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "px", "``", " ", "sets", " ", "an", " ", "expir", "e", " ", "flag", " ", "on", " ", "key", " ", "``", "name", "``", " ", "for", " ", "``", "px", "``", " ", "milliseconds", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "nx", "``", " ", "if", " ", "set", " ", "to", " ", "Tru", "e", ",", " ", "set", " ", "the", " ", "value", " ", "at", " ", "key", " ", "``", "name", "``", " ", "to", " ", "``", "value", "``", " ", "if", " ", "it", "\\", "10", ";", " ", " ", " ", " ", "doe", "s", " ", "not", " ", "alr", "ead", "y", " ", "exist", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "xx", "``", " ", "if", " ", "set", " ", "to", " ", "Tru", "e", ",", " ", "set", " ", "the", " ", "value", " ", "at", " ", "key", " ", "``", "name", "``", " ", "to", " ", "``", "value", "``", " ", "if", " ", "it", "\\", "10", ";", " ", " ", " ", " ", "alr", "ead", "y", " ", "exist", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "=_", "[_", "name_", ",_", "value_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ex_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "'", "EX", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "ex_", ",_", "datetime_", "._", "timedelta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ex_", "=_", "ex_", "._", "seconds_", "+_", "ex_", "._", "days_", "*_", "24_", "*_", "3600_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pieces_", "._", "append_", "(_", "ex_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "px_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "'", "PX", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "px_", ",_", "datetime_", "._", "timedelta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ms_", "=_", "int_", "(_", "px_", "._", "microseconds_", "/_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "px_", "=_", "(_", "px_", "._", "seconds_", "+_", "px_", "._", "days_", "*_", "24_", "*_", "3600_", ")_", "*_", "1000_", "+_", "ms_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pieces_", "._", "append_", "(_", "px_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "nx_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "'", "NX", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "xx_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "'", "XX", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SET", "'_", ",_", "*_", "pieces_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "setitem\\u\\u_", "(_", "self_", ",_", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set_", "(_", "name_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "setb", "it_", "(_", "self_", ",_", "name_", ",_", "offset_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Fla", "g", " ", "the", " ", "``", "offset", "``", " ", "in", " ", "``", "name", "``", " ", "as", " ", "``", "value", "``.", " ", "Return", "s", " ", "a", " ", "boolean", "\\", "10", ";", " ", " ", " ", " ", "indicati", "ng", " ", "the", " ", "previ", "ous", " ", "value", " ", "of", " ", "``", "offset", "``.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "value_", "=_", "value_", "and_", "1_", "or_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SET", "BIT", "'_", ",_", "name_", ",_", "offset_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sete", "x_", "(_", "self_", ",_", "name_", ",_", "time_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "the", " ", "value", " ", "of", " ", "key", " ", "``", "name", "``", " ", "to", " ", "``", "value", "``", " ", "tha", "t", " ", "expir", "es", " ", "in", " ", "``", "time", "``", "\\", "10", ";", " ", " ", " ", " ", "second", "s", ".", " ", "``", "time", "``", " ", "can", " ", "be", " ", "represent", "ed", " ", "by", " ", "an", " ", "integ", "er", " ", "or", " ", "a", " ", "Pyth", "on", "\\", "10", ";", " ", " ", " ", " ", "timedelta", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "time_", ",_", "datetime_", "._", "timedelta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "=_", "time_", "._", "seconds_", "+_", "time_", "._", "days_", "*_", "24_", "*_", "3600_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SET", "EX", "'_", ",_", "name_", ",_", "time_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "setn", "x_", "(_", "self_", ",_", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Set", " ", "the", " ", "value", " ", "of", " ", "key", " ", "``", "name", "``", " ", "to", " ", "``", "value", "``", " ", "if", " ", "key", " ", "doe", "sn", "'", "t", " ", "exist", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SET", "NX", "'_", ",_", "name_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "range_", "(_", "self_", ",_", "name_", ",_", "offset_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Over", "write", " ", "bytes", " ", "in", " ", "the", " ", "value", " ", "of", " ", "``", "name", "``", " ", "startin", "g", " ", "at", " ", "``", "offset", "``", " ", "with", "\\", "10", ";", " ", " ", " ", " ", "``", "value", "``.", " ", "If", " ", "``", "offset", "``", " ", "plus", " ", "the", " ", "length", " ", "of", " ", "``", "value", "``", " ", "exceed", "s", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "length", " ", "of", " ", "the", " ", "original", " ", "value", ",", " ", "the", " ", "new", " ", "value", " ", "will", " ", "be", " ", "large", "r", " ", "than", " ", "bef", "ore", ".", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "``", "offset", "``", " ", "exceed", "s", " ", "the", " ", "length", " ", "of", " ", "the", " ", "original", " ", "value", ",", " ", "null", " ", "bytes", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "be", " ", "used", " ", "to", " ", "pad", " ", "bet", "ween", " ", "the", " ", "end", " ", "of", " ", "the", " ", "previ", "ous", " ", "value", " ", "and", " ", "the", " ", "start", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "what", "'", "s", " ", "bei", "ng", " ", "injected", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "length", " ", "of", " ", "the", " ", "new", " ", "string", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SET", "RANGE", "'_", ",_", "name_", ",_", "offset_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "strl", "en_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "bytes", " ", "store", "d", " ", "in", " ", "the", " ", "value", " ", "of", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "STR", "LEN", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "substr_", "(_", "self_", ",_", "name_", ",_", "start_", ",_", "end_", "=_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "substring", " ", "of", " ", "the", " ", "string", " ", "at", " ", "key", " ", "``", "name", "``.", " ", "``", "start", "``", " ", "and", " ", "``", "end", "``", "\\", "10", ";", " ", " ", " ", " ", "are", " ", "0", "-", "based", " ", "integ", "ers", " ", "speci", "fy", "ing", " ", "the", " ", "porti", "on", " ", "of", " ", "the", " ", "string", " ", "to", " ", "return", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SUBST", "R", "'_", ",_", "name_", ",_", "start_", ",_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ttl_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "the", " ", "number", " ", "of", " ", "second", "s", " ", "unti", "l", " ", "the", " ", "key", " ", "``", "name", "``", " ", "will", " ", "expir", "e", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "TTL", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "type_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "the", " ", "type", " ", "of", " ", "key", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "TYPE", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "watch_", "(_", "self_", ",_", "*_", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Watch", "es", " ", "the", " ", "values", " ", "at", " ", "keys", " ", "``", "names", "``", ",", " ", "or", " ", "Non", "e", " ", "if", " ", "the", " ", "key", " ", "doe", "sn", "'", "t", " ", "exist", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warnings_", "._", "warn_", "(_", "Dep", "reca", "tion", "Warning_", "(_", "'", "Call", " ", "WATCH", " ", "from", " ", "a", " ", "Pipe", "line", " ", "object", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "unwa", "tch_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Un", "watch", "es", " ", "the", " ", "value", " ", "at", " ", "key", " ", "``", "name", "``", ",", " ", "or", " ", "Non", "e", " ", "of", " ", "the", " ", "key", " ", "doe", "sn", "'", "t", " ", "exist", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warnings_", "._", "warn_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Dep", "reca", "tion", "Warning_", "(_", "'", "Call", " ", "UN", "WATCH", " ", "from", " ", "a", " ", "Pipe", "line", " ", "object", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "bl", "pop_", "(_", "self_", ",_", "keys_", ",_", "timeout_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "LP", "OP", " ", "a", " ", "value", " ", "off", " ", "of", " ", "the", " ", "first", " ", "non", "-", "empty", " ", "list", "\\", "10", ";", " ", " ", " ", " ", "named", " ", "in", " ", "the", " ", "``", "keys", "``", " ", "list", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "none", " ", "of", " ", "the", " ", "lists", " ", "in", " ", "``", "keys", "``", " ", "has", " ", "a", " ", "value", " ", "to", " ", "LP", "OP", ",", " ", "then", " ", "block", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "``", "timeo", "ut", "``", " ", "second", "s", ",", " ", "or", " ", "unti", "l", " ", "a", " ", "value", " ", "gets", " ", "pushed", " ", "on", " ", "to", " ", "one", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "the", " ", "lists", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "timeo", "ut", " ", "is", " ", "0", ",", " ", "then", " ", "block", " ", "inde", "finite", "ly", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "timeout_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timeout_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "keys_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keys_", "=_", "[_", "keys_", "]_", "\\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 ", " _", "keys_", "=_", "list_", "(_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "keys_", "._", "append_", "(_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "BL", "POP", "'_", ",_", "*_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "br", "pop_", "(_", "self_", ",_", "keys_", ",_", "timeout_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "RP", "OP", " ", "a", " ", "value", " ", "off", " ", "of", " ", "the", " ", "first", " ", "non", "-", "empty", " ", "list", "\\", "10", ";", " ", " ", " ", " ", "named", " ", "in", " ", "the", " ", "``", "keys", "``", " ", "list", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "none", " ", "of", " ", "the", " ", "lists", " ", "in", " ", "``", "keys", "``", " ", "has", " ", "a", " ", "value", " ", "to", " ", "LP", "OP", ",", " ", "then", " ", "block", "\\", "10", ";", " ", " ", " ", " ", "for", " ", "``", "timeo", "ut", "``", " ", "second", "s", ",", " ", "or", " ", "unti", "l", " ", "a", " ", "value", " ", "gets", " ", "pushed", " ", "on", " ", "to", " ", "one", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "the", " ", "lists", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "timeo", "ut", " ", "is", " ", "0", ",", " ", "then", " ", "block", " ", "inde", "finite", "ly", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "timeout_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timeout_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "keys_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keys_", "=_", "[_", "keys_", "]_", "\\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 ", " _", "keys_", "=_", "list_", "(_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "keys_", "._", "append_", "(_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "BR", "POP", "'_", ",_", "*_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "br", "pop", "lp", "ush_", "(_", "self_", ",_", "src_", ",_", "dst_", ",_", "timeout_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Pop", " ", "a", " ", "value", " ", "off", " ", "the", " ", "tail", " ", "of", " ", "``", "src", "``", ",", " ", "push", " ", "it", " ", "on", " ", "the", " ", "head", " ", "of", " ", "``", "dst", "``", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "then", " ", "return", " ", "it", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "command", " ", "blocks", " ", "unti", "l", " ", "a", " ", "value", " ", "is", " ", "in", " ", "``", "src", "``", " ", "or", " ", "unti", "l", " ", "``", "timeo", "ut", "``", "\\", "10", ";", " ", " ", " ", " ", "second", "s", " ", "ela", "pse", ",", " ", "whi", "che", "ver", " ", "is", " ", "first", ".", " ", "A", " ", "``", "timeo", "ut", "``", " ", "value", " ", "of", " ", "0", " ", "blocks", "\\", "10", ";", " ", " ", " ", " ", "forever", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "timeout_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "timeout_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "BR", "POP", "LP", "US", "H", "'_", ",_", "src_", ",_", "dst_", ",_", "timeout_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "lind", "ex_", "(_", "self_", ",_", "name_", ",_", "index_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "item", " ", "from", " ", "list", " ", "``", "name", "``", " ", "at", " ", "position", " ", "``", "index", "``", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Nega", "tiv", "e", " ", "indexe", "s", " ", "are", " ", "support", "ed", " ", "and", " ", "will", " ", "return", " ", "an", " ", "item", " ", "at", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "end", " ", "of", " ", "the", " ", "list", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "LIN", "DE", "X", "'_", ",_", "name_", ",_", "index_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "lins", "ert_", "(_", "self_", ",_", "name_", ",_", "where_", ",_", "ref", "value_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Insert", " ", "``", "value", "``", " ", "in", " ", "list", " ", "``", "name", "``", " ", "eit", "her", " ", "immediate", "ly", " ", "bef", "ore", " ", "or", " ", "after", "\\", "10", ";", " ", " ", " ", " ", "[", "``", "where", "``", "]", " ", "``", "ref", "value", "``", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "new", " ", "length", " ", "of", " ", "the", " ", "list", " ", "on", " ", "success", " ", "or", " ", "-1", " ", "if", " ", "``", "ref", "value", "``", "\\", "10", ";", " ", " ", " ", " ", "is", " ", "not", " ", "in", " ", "the", " ", "list", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "LIN", "SER", "T", "'_", ",_", "name_", ",_", "where_", ",_", "ref", "value_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "llen", "_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "the", " ", "length", " ", "of", " ", "the", " ", "list", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "LLE", "N", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "lpo", "p_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Remove", " ", "and", " ", "return", " ", "the", " ", "first", " ", "item", " ", "of", " ", "the", " ", "list", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "LP", "OP", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "lp", "ush_", "(_", "self_", ",_", "name_", ",_", "*_", "values_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Push", " ", "``", "values", "``", " ", "onto", " ", "the", " ", "head", " ", "of", " ", "the", " ", "list", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "LP", "US", "H", "'_", ",_", "name_", ",_", "*_", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "lp", "ush", "x_", "(_", "self_", ",_", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Push", " ", "``", "value", "``", " ", "onto", " ", "the", " ", "head", " ", "of", " ", "the", " ", "list", " ", "``", "name", "``", " ", "if", " ", "``", "name", "``", " ", "exist", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "LP", "US", "HX", "'_", ",_", "name_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "lra", "nge_", "(_", "self_", ",_", "name_", ",_", "start_", ",_", "end_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "slice", " ", "of", " ", "the", " ", "list", " ", "``", "name", "``", " ", "bet", "ween", "\\", "10", ";", " ", " ", " ", " ", "position", " ", "``", "start", "``", " ", "and", " ", "``", "end", "``", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "start", "``", " ", "and", " ", "``", "end", "``", " ", "can", " ", "be", " ", "negati", "ve", " ", "numbers", " ", "just", " ", "like", "\\", "10", ";", " ", " ", " ", " ", "Pyth", "on", " ", "slicing", " ", "notation", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "LR", "ANGE", "'_", ",_", "name_", ",_", "start_", ",_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "lre", "m_", "(_", "self_", ",_", "name_", ",_", "count_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Remove", " ", "the", " ", "first", " ", "``", "count", "``", " ", "occurrences", " ", "of", " ", "element", "s", " ", "equal", " ", "to", " ", "``", "value", "``", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "the", " ", "list", " ", "store", "d", " ", "at", " ", "``", "name", "``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "count", " ", "argu", "ment", " ", "influence", "s", " ", "the", " ", "operati", "on", " ", "in", " ", "the", " ", "follow", "ing", " ", "way", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "count", " ", ">", " ", "0", ":", " ", "Remove", " ", "element", "s", " ", "equal", " ", "to", " ", "value", " ", "movin", "g", " ", "from", " ", "head", " ", "to", " ", "tail", ".", "\\", "10", ";", " ", " ", " ", " ", "count", " ", "<", " ", "0", ":", " ", "Remove", " ", "element", "s", " ", "equal", " ", "to", " ", "value", " ", "movin", "g", " ", "from", " ", "tail", " ", "to", " ", "head", ".", "\\", "10", ";", " ", " ", " ", " ", "count", " ", "=", " ", "0", ":", " ", "Remove", " ", "all", " ", "element", "s", " ", "equal", " ", "to", " ", "value", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "LR", "EM", "'_", ",_", "name_", ",_", "count_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "lse", "t_", "(_", "self_", ",_", "name_", ",_", "index_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Set", " ", "``", "position", "``", " ", "of", " ", "list", " ", "``", "name", "``", " ", "to", " ", "``", "value", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "LS", "ET", "'_", ",_", "name_", ",_", "index_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ltr", "im_", "(_", "self_", ",_", "name_", ",_", "start_", ",_", "end_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Trim", " ", "the", " ", "list", " ", "``", "name", "``", ",", " ", "remo", "ving", " ", "all", " ", "values", " ", "not", " ", "within", " ", "the", " ", "slice", "\\", "10", ";", " ", " ", " ", " ", "bet", "ween", " ", "``", "start", "``", " ", "and", " ", "``", "end", "``", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "start", "``", " ", "and", " ", "``", "end", "``", " ", "can", " ", "be", " ", "negati", "ve", " ", "numbers", " ", "just", " ", "like", "\\", "10", ";", " ", " ", " ", " ", "Pyth", "on", " ", "slicing", " ", "notation", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "LT", "RI", "M", "'_", ",_", "name_", ",_", "start_", ",_", "end_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rpo", "p_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Remove", " ", "and", " ", "return", " ", "the", " ", "last", " ", "item", " ", "of", " ", "the", " ", "list", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "RP", "OP", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rpo", "pl", "push_", "(_", "self_", ",_", "src_", ",_", "dst_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "RP", "OP", " ", "a", " ", "value", " ", "off", " ", "of", " ", "the", " ", "``", "src", "``", " ", "list", " ", "and", " ", "atomi", "call", "y", " ", "LP", "US", "H", " ", "it", "\\", "10", ";", " ", " ", " ", " ", "on", " ", "to", " ", "the", " ", "``", "dst", "``", " ", "list", ".", " ", " ", "Return", "s", " ", "the", " ", "value", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "RP", "OP", "LP", "US", "H", "'_", ",_", "src_", ",_", "dst_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rp", "ush_", "(_", "self_", ",_", "name_", ",_", "*_", "values_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Push", " ", "``", "values", "``", " ", "onto", " ", "the", " ", "tail", " ", "of", " ", "the", " ", "list", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "RP", "US", "H", "'_", ",_", "name_", ",_", "*_", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "rp", "ush", "x_", "(_", "self_", ",_", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Push", " ", "``", "value", "``", " ", "onto", " ", "the", " ", "tail", " ", "of", " ", "the", " ", "list", " ", "``", "name", "``", " ", "if", " ", "``", "name", "``", " ", "exist", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "RP", "US", "HX", "'_", ",_", "name_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sort_", "(_", "self_", ",_", "name_", ",_", "start_", "=_", "None_", ",_", "num_", "=_", "None_", ",_", "by_", "=_", "None_", ",_", "get_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "desc_", "=_", "False_", ",_", "alpha_", "=_", "False_", ",_", "store_", "=_", "None_", ",_", "groups_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sort", " ", "and", " ", "return", " ", "the", " ", "list", ",", " ", "set", " ", "or", " ", "sorte", "d", " ", "set", " ", "at", " ", "``", "name", "``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "start", "``", " ", "and", " ", "``", "num", "``", " ", "allow", " ", "for", " ", "paging", " ", "through", " ", "the", " ", "sorte", "d", " ", "data", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "by", "``", " ", "allow", "s", " ", "usi", "ng", " ", "an", " ", "external", " ", "key", " ", "to", " ", "weight", " ", "and", " ", "sort", " ", "the", " ", "items", ".", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "an", " ", "\"*", "\"", " ", "to", " ", "indicat", "e", " ", "where", " ", "in", " ", "the", " ", "key", " ", "the", " ", "item", " ", "value", " ", "is", " ", "located", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "get", "``", " ", "allow", "s", " ", "for", " ", "return", "ing", " ", "items", " ", "from", " ", "external", " ", "keys", " ", "rat", "her", " ", "than", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "sorte", "d", " ", "data", " ", "its", "elf", ".", " ", " ", "Us", "e", " ", "an", " ", "\"*", "\"", " ", "to", " ", "indicat", "e", " ", "where", " ", "int", " ", "he", " ", "key", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "item", " ", "value", " ", "is", " ", "located", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "desc", "``", " ", "allow", "s", " ", "for", " ", "reversi", "ng", " ", "the", " ", "sort", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "alpha", "``", " ", "allow", "s", " ", "for", " ", "sorting", " ", "lexi", "cog", "raph", "ical", "ly", " ", "rat", "her", " ", "than", " ", "numerical", "ly", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "store", "``", " ", "allow", "s", " ", "for", " ", "stor", "ing", " ", "the", " ", "result", " ", "of", " ", "the", " ", "sort", " ", "int", "o", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "key", " ", "``", "store", "``", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "group", "s", "``", " ", "if", " ", "set", " ", "to", " ", "Tru", "e", " ", "and", " ", "if", " ", "``", "get", "``", " ", "contain", "s", " ", "at", " ", "leas", "t", " ", "two", "\\", "10", ";", " ", " ", " ", " ", "element", "s", ",", " ", "sort", " ", "will", " ", "return", " ", "a", " ", "list", " ", "of", " ", "tuple", "s", ",", " ", "each", " ", "contain", "ing", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "values", " ", "fetched", " ", "from", " ", "the", " ", "argu", "ment", "s", " ", "to", " ", "``", "get", "``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "start_", "is_", "not_", "None_", "and_", "num_", "is_", "None_", ")_", "or_", "(_", "num_", "is_", "not_", "None_", "and_", "start_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Red", "is", "Error_", "(_", "\"``", "start", "``", " ", "and", " ", "``", "num", "``", " ", "must", " ", "bot", "h", " ", "be", " ", "specified", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pieces_", "=_", "[_", "name_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "by_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "Token_", "(_", "'", "BY", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "._", "append_", "(_", "by_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "start_", "is_", "not_", "None_", "and_", "num_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "Token_", "(_", "'", "LIMIT", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "._", "append_", "(_", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "._", "append_", "(_", "num_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "get_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "get", " ", "is", " ", "a", " ", "string", " ", "assume", " ", "we", " ", "want", " ", "to", " ", "get", " ", "a", " ", "single", " ", "value", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Ot", "her", "wis", "e", " ", "assume", " ", "it", "'", "s", " ", "an", " ", "inter", "able", " ", "and", " ", "we", " ", "want", " ", "to", " ", "get", " ", "multiple_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "values", ".", " ", "We", " ", "can", "'", "t", " ", "just", " ", "iterate", " ", "blind", "ly", " ", "bec", "aus", "e", " ", "string", "s", " ", "are", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "iterable", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "get_", ",_", "basestring_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "Token_", "(_", "'", "GET", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "._", "append_", "(_", "get_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "g_", "in_", "get_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pieces_", "._", "append_", "(_", "Token_", "(_", "'", "GET", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "._", "append_", "(_", "g_", ")_", "\\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_", "desc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "Token_", "(_", "'", "DESC", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "alpha_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "Token_", "(_", "'", "ALPHA", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "store_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "Token_", "(_", "'", "STORE", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "._", "append_", "(_", "store_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "groups_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "get_", "or_", "isinstance_", "(_", "get_", ",_", "basestring_", ")_", "or_", "len_", "(_", "get_", ")_", "<_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Data", "Error_", "(_", "'", "whe", "n", " ", "usi", "ng", " ", "\"", "group", "s", "\"", " ", "the", " ", "\"", "get", "\"", " ", "argu", "ment", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "must", " ", "be", " ", "specified", " ", "and", " ", "contain", " ", "at", " ", "leas", "t", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "two", " ", "keys", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "=_", "{_", "'", "group", "s", "'_", ":_", "len_", "(_", "get_", ")_", "if_", "groups_", "else_", "None_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SORT", "'_", ",_", "*_", "pieces_", ",_", "**_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "scan_", "(_", "self_", ",_", "cursor_", "=_", "0_", ",_", "match_", "=_", "None_", ",_", "count_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Increment", "ally", " ", "return", " ", "lists", " ", "of", " ", "key", " ", "names", ".", " ", "Al", "so", " ", "return", " ", "a", " ", "cursor", "\\", "10", ";", " ", " ", " ", " ", "indicati", "ng", " ", "the", " ", "scan", " ", "position", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "match", "``", " ", "allow", "s", " ", "for", " ", "filtering", " ", "the", " ", "keys", " ", "by", " ", "pattern", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "count", "``", " ", "allow", "s", " ", "for", " ", "hin", "t", " ", "the", " ", "minim", "um", " ", "number", " ", "of", " ", "return", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "=_", "[_", "cursor_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "extend_", "(_", "[_", "Token_", "(_", "'", "MATCH", "'_", ")_", ",_", "match_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "count_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "extend_", "(_", "[_", "Token_", "(_", "'", "COUNT", "'_", ")_", ",_", "count_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SCAN", "'_", ",_", "*_", "pieces_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "scan", "\\u", "iter_", "(_", "self_", ",_", "match_", "=_", "None_", ",_", "count_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Make", " ", "an", " ", "iter", "ator", " ", "usi", "ng", " ", "the", " ", "SCAN", " ", "command", " ", "so", " ", "tha", "t", " ", "the", " ", "client", " ", "doe", "sn", "'", "t", "\\", "10", ";", " ", " ", " ", " ", "need", " ", "to", " ", "remember", " ", "the", " ", "cursor", " ", "position", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "match", "``", " ", "allow", "s", " ", "for", " ", "filtering", " ", "the", " ", "keys", " ", "by", " ", "pattern", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "count", "``", " ", "allow", "s", " ", "for", " ", "hin", "t", " ", "the", " ", "minim", "um", " ", "number", " ", "of", " ", "return", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "=_", "'", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "cursor_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cursor_", ",_", "data_", "=_", "self_", "._", "scan_", "(_", "cursor_", "=_", "cursor_", ",_", "match_", "=_", "match_", ",_", "count_", "=_", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "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_", "ssc", "an_", "(_", "self_", ",_", "name_", ",_", "cursor_", "=_", "0_", ",_", "match_", "=_", "None_", ",_", "count_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Increment", "ally", " ", "return", " ", "lists", " ", "of", " ", "element", "s", " ", "in", " ", "a", " ", "set", ".", " ", "Al", "so", " ", "return", " ", "a", " ", "cursor", "\\", "10", ";", " ", " ", " ", " ", "indicati", "ng", " ", "the", " ", "scan", " ", "position", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "match", "``", " ", "allow", "s", " ", "for", " ", "filtering", " ", "the", " ", "keys", " ", "by", " ", "pattern", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "count", "``", " ", "allow", "s", " ", "for", " ", "hin", "t", " ", "the", " ", "minim", "um", " ", "number", " ", "of", " ", "return", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "=_", "[_", "name_", ",_", "cursor_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "extend_", "(_", "[_", "Token_", "(_", "'", "MATCH", "'_", ")_", ",_", "match_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "count_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "extend_", "(_", "[_", "Token_", "(_", "'", "COUNT", "'_", ")_", ",_", "count_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SS", "CAN", "'_", ",_", "*_", "pieces_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "ssc", "an", "\\u", "iter_", "(_", "self_", ",_", "name_", ",_", "match_", "=_", "None_", ",_", "count_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Make", " ", "an", " ", "iter", "ator", " ", "usi", "ng", " ", "the", " ", "SS", "CAN", " ", "command", " ", "so", " ", "tha", "t", " ", "the", " ", "client", " ", "doe", "sn", "'", "t", "\\", "10", ";", " ", " ", " ", " ", "need", " ", "to", " ", "remember", " ", "the", " ", "cursor", " ", "position", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "match", "``", " ", "allow", "s", " ", "for", " ", "filtering", " ", "the", " ", "keys", " ", "by", " ", "pattern", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "count", "``", " ", "allow", "s", " ", "for", " ", "hin", "t", " ", "the", " ", "minim", "um", " ", "number", " ", "of", " ", "return", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "=_", "'", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "cursor_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cursor_", ",_", "data_", "=_", "self_", "._", "ssc", "an_", "(_", "name_", ",_", "cursor_", "=_", "cursor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "match_", "=_", "match_", ",_", "count_", "=_", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "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_", "hsc", "an_", "(_", "self_", ",_", "name_", ",_", "cursor_", "=_", "0_", ",_", "match_", "=_", "None_", ",_", "count_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Increment", "ally", " ", "return", " ", "key", "/", "value", " ", "slice", "s", " ", "in", " ", "a", " ", "hash", ".", " ", "Al", "so", " ", "return", " ", "a", " ", "cursor", "\\", "10", ";", " ", " ", " ", " ", "indicati", "ng", " ", "the", " ", "scan", " ", "position", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "match", "``", " ", "allow", "s", " ", "for", " ", "filtering", " ", "the", " ", "keys", " ", "by", " ", "pattern", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "count", "``", " ", "allow", "s", " ", "for", " ", "hin", "t", " ", "the", " ", "minim", "um", " ", "number", " ", "of", " ", "return", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "=_", "[_", "name_", ",_", "cursor_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "extend_", "(_", "[_", "Token_", "(_", "'", "MATCH", "'_", ")_", ",_", "match_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "count_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "extend_", "(_", "[_", "Token_", "(_", "'", "COUNT", "'_", ")_", ",_", "count_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "HS", "CAN", "'_", ",_", "*_", "pieces_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hsc", "an", "\\u", "iter_", "(_", "self_", ",_", "name_", ",_", "match_", "=_", "None_", ",_", "count_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Make", " ", "an", " ", "iter", "ator", " ", "usi", "ng", " ", "the", " ", "HS", "CAN", " ", "command", " ", "so", " ", "tha", "t", " ", "the", " ", "client", " ", "doe", "sn", "'", "t", "\\", "10", ";", " ", " ", " ", " ", "need", " ", "to", " ", "remember", " ", "the", " ", "cursor", " ", "position", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "match", "``", " ", "allow", "s", " ", "for", " ", "filtering", " ", "the", " ", "keys", " ", "by", " ", "pattern", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "count", "``", " ", "allow", "s", " ", "for", " ", "hin", "t", " ", "the", " ", "minim", "um", " ", "number", " ", "of", " ", "return", "s", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "=_", "'", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "cursor_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cursor_", ",_", "data_", "=_", "self_", "._", "hsc", "an_", "(_", "name_", ",_", "cursor_", "=_", "cursor_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "match_", "=_", "match_", ",_", "count_", "=_", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "data_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "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_", "zsc", "an_", "(_", "self_", ",_", "name_", ",_", "cursor_", "=_", "0_", ",_", "match_", "=_", "None_", ",_", "count_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "score", "\\u", "cast", "\\u", "func_", "=_", "float_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Increment", "ally", " ", "return", " ", "lists", " ", "of", " ", "element", "s", " ", "in", " ", "a", " ", "sorte", "d", " ", "set", ".", " ", "Al", "so", " ", "return", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "cursor", " ", "indicati", "ng", " ", "the", " ", "scan", " ", "position", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "match", "``", " ", "allow", "s", " ", "for", " ", "filtering", " ", "the", " ", "keys", " ", "by", " ", "pattern", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "count", "``", " ", "allow", "s", " ", "for", " ", "hin", "t", " ", "the", " ", "minim", "um", " ", "number", " ", "of", " ", "return", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "score", "\\u", "cast", "\\u", "func", "``", " ", "a", " ", "calla", "ble", " ", "used", " ", "to", " ", "cast", " ", "the", " ", "score", " ", "return", " ", "value", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "=_", "[_", "name_", ",_", "cursor_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "match_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "extend_", "(_", "[_", "Token_", "(_", "'", "MATCH", "'_", ")_", ",_", "match_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "count_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "extend_", "(_", "[_", "Token_", "(_", "'", "COUNT", "'_", ")_", ",_", "count_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "=_", "{_", "'", "score", "\\u", "cast", "\\u", "func", "'_", ":_", "score", "\\u", "cast", "\\u", "func_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "ZS", "CAN", "'_", ",_", "*_", "pieces_", ",_", "**_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zsc", "an", "\\u", "iter_", "(_", "self_", ",_", "name_", ",_", "match_", "=_", "None_", ",_", "count_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "score", "\\u", "cast", "\\u", "func_", "=_", "float_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Make", " ", "an", " ", "iter", "ator", " ", "usi", "ng", " ", "the", " ", "ZS", "CAN", " ", "command", " ", "so", " ", "tha", "t", " ", "the", " ", "client", " ", "doe", "sn", "'", "t", "\\", "10", ";", " ", " ", " ", " ", "need", " ", "to", " ", "remember", " ", "the", " ", "cursor", " ", "position", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "match", "``", " ", "allow", "s", " ", "for", " ", "filtering", " ", "the", " ", "keys", " ", "by", " ", "pattern", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "count", "``", " ", "allow", "s", " ", "for", " ", "hin", "t", " ", "the", " ", "minim", "um", " ", "number", " ", "of", " ", "return", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "score", "\\u", "cast", "\\u", "func", "``", " ", "a", " ", "calla", "ble", " ", "used", " ", "to", " ", "cast", " ", "the", " ", "score", " ", "return", " ", "value", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cursor_", "=_", "'", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "cursor_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cursor_", ",_", "data_", "=_", "self_", "._", "zsc", "an_", "(_", "name_", ",_", "cursor_", "=_", "cursor_", ",_", "match_", "=_", "match_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "count_", "=_", "count_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "score", "\\u", "cast", "\\u", "func_", "=_", "score", "\\u", "cast", "\\u", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "item_", "in_", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "yield_", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "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_", "sadd", "_", "(_", "self_", ",_", "name_", ",_", "*_", "values_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Add", " ", "``", "value", "(", "s", ")`", "`", " ", "to", " ", "set", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SA", "DD", "'_", ",_", "name_", ",_", "*_", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "scar", "d_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "element", "s", " ", "in", " ", "set", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SCA", "RD", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sdi", "ff_", "(_", "self_", ",_", "keys_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "the", " ", "difference", " ", "of", " ", "sets", " ", "specified", " ", "by", " ", "``", "keys", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "list", "\\u", "or", "\\u", "args_", "(_", "keys_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SD", "IF", "F", "'_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sdi", "ffs", "tore_", "(_", "self_", ",_", "dest_", ",_", "keys_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Stor", "e", " ", "the", " ", "difference", " ", "of", " ", "sets", " ", "specified", " ", "by", " ", "``", "keys", "``", " ", "int", "o", " ", "a", " ", "new", "\\", "10", ";", " ", " ", " ", " ", "set", " ", "named", " ", "``", "dest", "``.", " ", " ", "Return", "s", " ", "the", " ", "number", " ", "of", " ", "keys", " ", "in", " ", "the", " ", "new", " ", "set", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "list", "\\u", "or", "\\u", "args_", "(_", "keys_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SD", "IF", "FS", "TOR", "E", "'_", ",_", "dest_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sint", "er_", "(_", "self_", ",_", "keys_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "the", " ", "intersect", "ion", " ", "of", " ", "sets", " ", "specified", " ", "by", " ", "``", "keys", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "list", "\\u", "or", "\\u", "args_", "(_", "keys_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SIN", "TER", "'_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sint", "ers", "tore_", "(_", "self_", ",_", "dest_", ",_", "keys_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Stor", "e", " ", "the", " ", "intersect", "ion", " ", "of", " ", "sets", " ", "specified", " ", "by", " ", "``", "keys", "``", " ", "int", "o", " ", "a", " ", "new", "\\", "10", ";", " ", " ", " ", " ", "set", " ", "named", " ", "``", "dest", "``.", " ", " ", "Return", "s", " ", "the", " ", "number", " ", "of", " ", "keys", " ", "in", " ", "the", " ", "new", " ", "set", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "list", "\\u", "or", "\\u", "args_", "(_", "keys_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SIN", "TER", "STORE", "'_", ",_", "dest_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sis", "member_", "(_", "self_", ",_", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "a", " ", "boolean", " ", "indicati", "ng", " ", "if", " ", "``", "value", "``", " ", "is", " ", "a", " ", "member", " ", "of", " ", "set", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SIS", "MEMBER", "'_", ",_", "name_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sme", "mber", "s_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "all", " ", "member", "s", " ", "of", " ", "the", " ", "set", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SM", "EM", "BER", "S", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "smo", "ve_", "(_", "self_", ",_", "src_", ",_", "dst_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Move", " ", "``", "value", "``", " ", "from", " ", "set", " ", "``", "src", "``", " ", "to", " ", "set", " ", "``", "dst", "``", " ", "atomi", "call", "y", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SMO", "VE", "'_", ",_", "src_", ",_", "dst_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "spo", "p_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Remove", " ", "and", " ", "return", " ", "a", " ", "random", " ", "member", " ", "of", " ", "set", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SPO", "P", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sra", "ndm", "ember", "_", "(_", "self_", ",_", "name_", ",_", "number_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "``", "number", "``", " ", "is", " ", "Non", "e", ",", " ", "return", "s", " ", "a", " ", "random", " ", "member", " ", "of", " ", "set", " ", "``", "name", "``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "``", "number", "``", " ", "is", " ", "supplie", "d", ",", " ", "return", "s", " ", "a", " ", "list", " ", "of", " ", "``", "number", "``", " ", "random", "\\", "10", ";", " ", " ", " ", " ", "meme", "bers", " ", "of", " ", "set", " ", "``", "name", "``.", " ", "Not", "e", " ", "this", " ", "is", " ", "only", " ", "avail", "able", " ", "whe", "n", " ", "runn", "ing", "\\", "10", ";", " ", " ", " ", " ", "Red", "is", " ", "2.6", "+.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "number_", "and_", "[_", "number_", "]_", "or_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SR", "AND", "MEMBER", "'_", ",_", "name_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sre", "m_", "(_", "self_", ",_", "name_", ",_", "*_", "values_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Remove", " ", "``", "values", "``", " ", "from", " ", "set", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SRE", "M", "'_", ",_", "name_", ",_", "*_", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sun", "ion_", "(_", "self_", ",_", "keys_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "the", " ", "uni", "on", " ", "of", " ", "sets", " ", "specified", " ", "by", " ", "``", "keys", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "list", "\\u", "or", "\\u", "args_", "(_", "keys_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SUN", "ION", "'_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sun", "ion", "store_", "(_", "self_", ",_", "dest_", ",_", "keys_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Stor", "e", " ", "the", " ", "uni", "on", " ", "of", " ", "sets", " ", "specified", " ", "by", " ", "``", "keys", "``", " ", "int", "o", " ", "a", " ", "new", "\\", "10", ";", " ", " ", " ", " ", "set", " ", "named", " ", "``", "dest", "``.", " ", " ", "Return", "s", " ", "the", " ", "number", " ", "of", " ", "keys", " ", "in", " ", "the", " ", "new", " ", "set", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "list", "\\u", "or", "\\u", "args_", "(_", "keys_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SUN", "IONS", "TOR", "E", "'_", ",_", "dest_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zad", "d_", "(_", "self_", ",_", "name_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "any", " ", "number", " ", "of", " ", "score", ",", " ", "element", "-", "name", " ", "pair", "s", " ", "to", " ", "the", " ", "key", " ", "``", "name", "``.", " ", "Pair", "s", "\\", "10", ";", " ", " ", " ", " ", "can", " ", "be", " ", "specified", " ", "in", " ", "two", " ", "way", "s", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "As", " ", "*", "args", ",", " ", "in", " ", "the", " ", "form", " ", "of", ":", " ", "score", "1", ",", " ", "name", "1", ",", " ", "score", "2", ",", " ", "name2", ",", " ", "...", "\\", "10", ";", " ", " ", " ", " ", "or", " ", "as", " ", "**", "kwarg", "s", ",", " ", "in", " ", "the", " ", "form", " ", "of", ":", " ", "name", "1", "=", "score", "1", ",", " ", "name2", "=", "score", "2", ",", " ", "...", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "follow", "ing", " ", "example", " ", "wou", "ld", " ", "add", " ", "four", " ", "values", " ", "to", " ", "the", " ", "'", "my", "-", "key", "'", " ", "key", ":", "\\", "10", ";", " ", " ", " ", " ", "redis", ".", "zad", "d", "('", "my", "-", "key", "',", " ", "1.1", ",", " ", "'", "name", "1", "',", " ", "2.2", ",", " ", "'", "name2", "',", " ", "name", "3", "=", "3.3", ",", " ", "name", "4", "=", "4.4", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "args_", ")_", "%_", "2_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Red", "is", "Error_", "(_", "\"", "ZA", "DD", " ", "require", "s", " ", "an", " ", "equal", " ", "number", " ", "of", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "values", " ", "and", " ", "score", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pieces_", "._", "extend_", "(_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "pair_", "in_", "iteritems_", "(_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "pair_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "._", "append_", "(_", "pair_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "ZA", "DD", "'_", ",_", "name_", ",_", "*_", "pieces_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zc", "ard_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "element", "s", " ", "in", " ", "the", " ", "sorte", "d", " ", "set", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "ZC", "ARD", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zc", "ount_", "(_", "self_", ",_", "name_", ",_", "min_", ",_", "max_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "number", " ", "of", " ", "element", "s", " ", "in", " ", "the", " ", "sorte", "d", " ", "set", " ", "at", " ", "key", " ", "``", "name", "``", " ", "with", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "score", " ", "bet", "ween", " ", "``", "min", "``", " ", "and", " ", "``", "max", "``.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "ZC", "OUN", "T", "'_", ",_", "name_", ",_", "min_", ",_", "max_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zin", "cr", "by_", "(_", "self_", ",_", "name_", ",_", "value_", ",_", "amount_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Increment", " ", "the", " ", "score", " ", "of", " ", "``", "value", "``", " ", "in", " ", "sorte", "d", " ", "set", " ", "``", "name", "``", " ", "by", " ", "``", "amo", "unt", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "ZI", "NC", "RB", "Y", "'_", ",_", "name_", ",_", "amount_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zin", "ters", "tore_", "(_", "self_", ",_", "dest_", ",_", "keys_", ",_", "aggregate_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Intersect", " ", "multiple", " ", "sorte", "d", " ", "sets", " ", "specified", " ", "by", " ", "``", "keys", "``", " ", "int", "o", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "new", " ", "sorte", "d", " ", "set", ",", " ", "``", "dest", "``.", " ", "Score", "s", " ", "in", " ", "the", " ", "destinat", "ion", " ", "will", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "aggregated", " ", "based", " ", "on", " ", "the", " ", "``", "aggre", "gate", "``", ",", " ", "or", " ", "SUM", " ", "if", " ", "none", " ", "is", " ", "provided", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "za", "gg", "rega", "te_", "(_", "'", "ZI", "NT", "ERS", "TOR", "E", "'_", ",_", "dest_", ",_", "keys_", ",_", "aggregate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zl", "exc", "ount_", "(_", "self_", ",_", "name_", ",_", "min_", ",_", "max_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "number", " ", "of", " ", "items", " ", "in", " ", "the", " ", "sorte", "d", " ", "set", " ", "``", "name", "``", " ", "bet", "ween", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "lexi", "cog", "raph", "ical", " ", "range", " ", "``", "min", "``", " ", "and", " ", "``", "max", "``.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "ZL", "EXC", "OUN", "T", "'_", ",_", "name_", ",_", "min_", ",_", "max_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zr", "ange_", "(_", "self_", ",_", "name_", ",_", "start_", ",_", "end_", ",_", "desc_", "=_", "False_", ",_", "with", "scores_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "score", "\\u", "cast", "\\u", "func_", "=_", "float_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "range", " ", "of", " ", "values", " ", "from", " ", "sorte", "d", " ", "set", " ", "``", "name", "``", " ", "bet", "ween", "\\", "10", ";", " ", " ", " ", " ", "``", "start", "``", " ", "and", " ", "``", "end", "``", " ", "sorte", "d", " ", "in", " ", "ascen", "ding", " ", "order", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "start", "``", " ", "and", " ", "``", "end", "``", " ", "can", " ", "be", " ", "negati", "ve", ",", " ", "indicati", "ng", " ", "the", " ", "end", " ", "of", " ", "the", " ", "range", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "desc", "``", " ", "a", " ", "boolean", " ", "indicati", "ng", " ", "whe", "ther", " ", "to", " ", "sort", " ", "the", " ", "results", " ", "descend", "ingl", "y", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "with", "score", "s", "``", " ", "indicat", "es", " ", "to", " ", "return", " ", "the", " ", "score", "s", " ", "along", " ", "with", " ", "the", " ", "values", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "return", " ", "type", " ", "is", " ", "a", " ", "list", " ", "of", " ", "(", "value", ",", " ", "score", ")", " ", "pair", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "score", "\\u", "cast", "\\u", "func", "``", " ", "a", " ", "calla", "ble", " ", "used", " ", "to", " ", "cast", " ", "the", " ", "score", " ", "return", " ", "value", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "desc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "zr", "ev", "range_", "(_", "name_", ",_", "start_", ",_", "end_", ",_", "with", "scores_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "score", "\\u", "cast", "\\u", "func_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pieces_", "=_", "[_", "'", "ZR", "ANGE", "'_", ",_", "name_", ",_", "start_", ",_", "end_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "with", "scores_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "Token_", "(_", "'", "WITH", "SCORE", "S", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "with", "score", "s", "'_", ":_", "with", "scores_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "score", "\\u", "cast", "\\u", "func", "'_", ":_", "score", "\\u", "cast", "\\u", "func_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "*_", "pieces_", ",_", "**_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zr", "ange", "by", "lex_", "(_", "self_", ",_", "name_", ",_", "min_", ",_", "max_", ",_", "start_", "=_", "None_", ",_", "num_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "lexi", "cog", "raph", "ical", " ", "range", " ", "of", " ", "values", " ", "from", " ", "sorte", "d", " ", "set", " ", "``", "name", "``", "\\", "10", ";", " ", " ", " ", " ", "bet", "ween", " ", "``", "min", "``", " ", "and", " ", "``", "max", "``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "``", "start", "``", " ", "and", " ", "``", "num", "``", " ", "are", " ", "specified", ",", " ", "then", " ", "return", " ", "a", " ", "slice", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "range", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "start_", "is_", "not_", "None_", "and_", "num_", "is_", "None_", ")_", "or_", "(_", "num_", "is_", "not_", "None_", "and_", "start_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Red", "is", "Error_", "(_", "\"``", "start", "``", " ", "and", " ", "``", "num", "``", " ", "must", " ", "bot", "h", " ", "be", " ", "specified", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pieces_", "=_", "[_", "'", "ZR", "ANGE", "BY", "LEX", "'_", ",_", "name_", ",_", "min_", ",_", "max_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "start_", "is_", "not_", "None_", "and_", "num_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "extend_", "(_", "[_", "Token_", "(_", "'", "LIMIT", "'_", ")_", ",_", "start_", ",_", "num_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "*_", "pieces_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zr", "ev", "range", "by", "lex_", "(_", "self_", ",_", "name_", ",_", "max_", ",_", "min_", ",_", "start_", "=_", "None_", ",_", "num_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "reverse", "d", " ", "lexi", "cog", "raph", "ical", " ", "range", " ", "of", " ", "values", " ", "from", " ", "sorte", "d", " ", "set", "\\", "10", ";", " ", " ", " ", " ", "``", "name", "``", " ", "bet", "ween", " ", "``", "max", "``", " ", "and", " ", "``", "min", "``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "``", "start", "``", " ", "and", " ", "``", "num", "``", " ", "are", " ", "specified", ",", " ", "then", " ", "return", " ", "a", " ", "slice", " ", "of", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "range", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "start_", "is_", "not_", "None_", "and_", "num_", "is_", "None_", ")_", "or_", "(_", "num_", "is_", "not_", "None_", "and_", "start_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Red", "is", "Error_", "(_", "\"``", "start", "``", " ", "and", " ", "``", "num", "``", " ", "must", " ", "bot", "h", " ", "be", " ", "specified", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pieces_", "=_", "[_", "'", "ZR", "EV", "RANGE", "BY", "LEX", "'_", ",_", "name_", ",_", "max_", ",_", "min_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "start_", "is_", "not_", "None_", "and_", "num_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "extend_", "(_", "[_", "Token_", "(_", "'", "LIMIT", "'_", ")_", ",_", "start_", ",_", "num_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "*_", "pieces_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zr", "ange", "bys", "core_", "(_", "self_", ",_", "name_", ",_", "min_", ",_", "max_", ",_", "start_", "=_", "None_", ",_", "num_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "with", "scores_", "=_", "False_", ",_", "score", "\\u", "cast", "\\u", "func_", "=_", "float_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "range", " ", "of", " ", "values", " ", "from", " ", "the", " ", "sorte", "d", " ", "set", " ", "``", "name", "``", " ", "with", " ", "score", "s", "\\", "10", ";", " ", " ", " ", " ", "bet", "ween", " ", "``", "min", "``", " ", "and", " ", "``", "max", "``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "``", "start", "``", " ", "and", " ", "``", "num", "``", " ", "are", " ", "specified", ",", " ", "then", " ", "return", " ", "a", " ", "slice", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "the", " ", "range", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "with", "score", "s", "``", " ", "indicat", "es", " ", "to", " ", "return", " ", "the", " ", "score", "s", " ", "along", " ", "with", " ", "the", " ", "values", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "return", " ", "type", " ", "is", " ", "a", " ", "list", " ", "of", " ", "(", "value", ",", " ", "score", ")", " ", "pair", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "`", "score", "\\u", "cast", "\\u", "func", "``", " ", "a", " ", "calla", "ble", " ", "used", " ", "to", " ", "cast", " ", "the", " ", "score", " ", "return", " ", "value", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "start_", "is_", "not_", "None_", "and_", "num_", "is_", "None_", ")_", "or_", "(_", "num_", "is_", "not_", "None_", "and_", "start_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Red", "is", "Error_", "(_", "\"``", "start", "``", " ", "and", " ", "``", "num", "``", " ", "must", " ", "bot", "h", " ", "be", " ", "specified", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pieces_", "=_", "[_", "'", "ZR", "ANGE", "BY", "SCORE", "'_", ",_", "name_", ",_", "min_", ",_", "max_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "start_", "is_", "not_", "None_", "and_", "num_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "extend_", "(_", "[_", "Token_", "(_", "'", "LIMIT", "'_", ")_", ",_", "start_", ",_", "num_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "with", "scores_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "Token_", "(_", "'", "WITH", "SCORE", "S", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "with", "score", "s", "'_", ":_", "with", "scores_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "score", "\\u", "cast", "\\u", "func", "'_", ":_", "score", "\\u", "cast", "\\u", "func_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "*_", "pieces_", ",_", "**_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zr", "ank", "_", "(_", "self_", ",_", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "0", "-", "based", " ", "value", " ", "indicati", "ng", " ", "the", " ", "rank", " ", "of", " ", "``", "value", "``", " ", "in", " ", "sorte", "d", " ", "set", "\\", "10", ";", " ", " ", " ", " ", "``", "name", "``", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "ZR", "AN", "K", "'_", ",_", "name_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zr", "em_", "(_", "self_", ",_", "name_", ",_", "*_", "values_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Remove", " ", "member", " ", "``", "values", "``", " ", "from", " ", "sorte", "d", " ", "set", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "ZR", "EM", "'_", ",_", "name_", ",_", "*_", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zr", "emr", "ange", "by", "lex_", "(_", "self_", ",_", "name_", ",_", "min_", ",_", "max_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Remove", " ", "all", " ", "element", "s", " ", "in", " ", "the", " ", "sorte", "d", " ", "set", " ", "``", "name", "``", " ", "bet", "ween", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "lexi", "cog", "raph", "ical", " ", "range", " ", "specified", " ", "by", " ", "``", "min", "``", " ", "and", " ", "``", "max", "``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "number", " ", "of", " ", "element", "s", " ", "remove", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "ZR", "EM", "RANGE", "BY", "LEX", "'_", ",_", "name_", ",_", "min_", ",_", "max_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zr", "emr", "ange", "by", "rank_", "(_", "self_", ",_", "name_", ",_", "min_", ",_", "max_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Remove", " ", "all", " ", "element", "s", " ", "in", " ", "the", " ", "sorte", "d", " ", "set", " ", "``", "name", "``", " ", "with", " ", "ranks", " ", "bet", "ween", "\\", "10", ";", " ", " ", " ", " ", "``", "min", "``", " ", "and", " ", "``", "max", "``.", " ", "Value", "s", " ", "are", " ", "0", "-", "based", ",", " ", "order", "ed", " ", "from", " ", "smallest", " ", "score", "\\", "10", ";", " ", " ", " ", " ", "to", " ", "large", "st", ".", " ", "Value", "s", " ", "can", " ", "be", " ", "negati", "ve", " ", "indicati", "ng", " ", "the", " ", "high", "est", " ", "score", "s", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "number", " ", "of", " ", "element", "s", " ", "remove", "d", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "ZR", "EM", "RANGE", "BY", "RANK", "'_", ",_", "name_", ",_", "min_", ",_", "max_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zr", "emr", "ange", "bys", "core_", "(_", "self_", ",_", "name_", ",_", "min_", ",_", "max_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Remove", " ", "all", " ", "element", "s", " ", "in", " ", "the", " ", "sorte", "d", " ", "set", " ", "``", "name", "``", " ", "with", " ", "score", "s", "\\", "10", ";", " ", " ", " ", " ", "bet", "ween", " ", "``", "min", "``", " ", "and", " ", "``", "max", "``.", " ", "Return", "s", " ", "the", " ", "number", " ", "of", " ", "element", "s", " ", "remove", "d", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "ZR", "EM", "RANGE", "BY", "SCORE", "'_", ",_", "name_", ",_", "min_", ",_", "max_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zr", "ev", "range_", "(_", "self_", ",_", "name_", ",_", "start_", ",_", "end_", ",_", "with", "scores_", "=_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "score", "\\u", "cast", "\\u", "func_", "=_", "float_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "range", " ", "of", " ", "values", " ", "from", " ", "sorte", "d", " ", "set", " ", "``", "name", "``", " ", "bet", "ween", "\\", "10", ";", " ", " ", " ", " ", "``", "start", "``", " ", "and", " ", "``", "end", "``", " ", "sorte", "d", " ", "in", " ", "descend", "ing", " ", "order", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "start", "``", " ", "and", " ", "``", "end", "``", " ", "can", " ", "be", " ", "negati", "ve", ",", " ", "indicati", "ng", " ", "the", " ", "end", " ", "of", " ", "the", " ", "range", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "with", "score", "s", "``", " ", "indicat", "es", " ", "to", " ", "return", " ", "the", " ", "score", "s", " ", "along", " ", "with", " ", "the", " ", "values", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "return", " ", "type", " ", "is", " ", "a", " ", "list", " ", "of", " ", "(", "value", ",", " ", "score", ")", " ", "pair", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "score", "\\u", "cast", "\\u", "func", "``", " ", "a", " ", "calla", "ble", " ", "used", " ", "to", " ", "cast", " ", "the", " ", "score", " ", "return", " ", "value", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "=_", "[_", "'", "ZR", "EV", "RANGE", "'_", ",_", "name_", ",_", "start_", ",_", "end_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "with", "scores_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "Token_", "(_", "'", "WITH", "SCORE", "S", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "with", "score", "s", "'_", ":_", "with", "scores_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "score", "\\u", "cast", "\\u", "func", "'_", ":_", "score", "\\u", "cast", "\\u", "func_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "*_", "pieces_", ",_", "**_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zr", "ev", "range", "bys", "core_", "(_", "self_", ",_", "name_", ",_", "max_", ",_", "min_", ",_", "start_", "=_", "None_", ",_", "num_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "with", "scores_", "=_", "False_", ",_", "score", "\\u", "cast", "\\u", "func_", "=_", "float_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "range", " ", "of", " ", "values", " ", "from", " ", "the", " ", "sorte", "d", " ", "set", " ", "``", "name", "``", " ", "with", " ", "score", "s", "\\", "10", ";", " ", " ", " ", " ", "bet", "ween", " ", "``", "min", "``", " ", "and", " ", "``", "max", "``", " ", "in", " ", "descend", "ing", " ", "order", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "``", "start", "``", " ", "and", " ", "``", "num", "``", " ", "are", " ", "specified", ",", " ", "then", " ", "return", " ", "a", " ", "slice", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "the", " ", "range", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "with", "score", "s", "``", " ", "indicat", "es", " ", "to", " ", "return", " ", "the", " ", "score", "s", " ", "along", " ", "with", " ", "the", " ", "values", ".", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "return", " ", "type", " ", "is", " ", "a", " ", "list", " ", "of", " ", "(", "value", ",", " ", "score", ")", " ", "pair", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "``", "score", "\\u", "cast", "\\u", "func", "``", " ", "a", " ", "calla", "ble", " ", "used", " ", "to", " ", "cast", " ", "the", " ", "score", " ", "return", " ", "value", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "start_", "is_", "not_", "None_", "and_", "num_", "is_", "None_", ")_", "or_", "(_", "num_", "is_", "not_", "None_", "and_", "start_", "is_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Red", "is", "Error_", "(_", "\"``", "start", "``", " ", "and", " ", "``", "num", "``", " ", "must", " ", "bot", "h", " ", "be", " ", "specified", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pieces_", "=_", "[_", "'", "ZR", "EV", "RANGE", "BY", "SCORE", "'_", ",_", "name_", ",_", "max_", ",_", "min_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "start_", "is_", "not_", "None_", "and_", "num_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "extend_", "(_", "[_", "Token_", "(_", "'", "LIMIT", "'_", ")_", ",_", "start_", ",_", "num_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "with", "scores_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "Token_", "(_", "'", "WITH", "SCORE", "S", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "options_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "with", "score", "s", "'_", ":_", "with", "scores_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "score", "\\u", "cast", "\\u", "func", "'_", ":_", "score", "\\u", "cast", "\\u", "func_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "*_", "pieces_", ",_", "**_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zr", "ev", "rank_", "(_", "self_", ",_", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "0", "-", "based", " ", "value", " ", "indicati", "ng", " ", "the", " ", "descend", "ing", " ", "rank", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "``", "value", "``", " ", "in", " ", "sorte", "d", " ", "set", " ", "``", "name", "``", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "ZR", "EV", "RANK", "'_", ",_", "name_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zsc", "ore_", "(_", "self_", ",_", "name_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "the", " ", "score", " ", "of", " ", "element", " ", "``", "value", "``", " ", "in", " ", "sorte", "d", " ", "set", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "ZS", "CORE", "'_", ",_", "name_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zu", "nio", "nst", "ore_", "(_", "self_", ",_", "dest_", ",_", "keys_", ",_", "aggregate_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Uni", "on", " ", "multiple", " ", "sorte", "d", " ", "sets", " ", "specified", " ", "by", " ", "``", "keys", "``", " ", "int", "o", "\\", "10", ";", " ", " ", " ", " ", "a", " ", "new", " ", "sorte", "d", " ", "set", ",", " ", "``", "dest", "``.", " ", "Score", "s", " ", "in", " ", "the", " ", "destinat", "ion", " ", "will", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "aggregated", " ", "based", " ", "on", " ", "the", " ", "``", "aggre", "gate", "``", ",", " ", "or", " ", "SUM", " ", "if", " ", "none", " ", "is", " ", "provided", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "\\u", "za", "gg", "rega", "te_", "(_", "'", "ZU", "NI", "ONS", "TOR", "E", "'_", ",_", "dest_", ",_", "keys_", ",_", "aggregate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "za", "gg", "rega", "te_", "(_", "self_", ",_", "command_", ",_", "dest_", ",_", "keys_", ",_", "aggregate_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "=_", "[_", "command_", ",_", "dest_", ",_", "len_", "(_", "keys_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "keys_", ",_", "dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "keys_", ",_", "weights_", "=_", "iterkeys_", "(_", "keys_", ")_", ",_", "itervalues_", "(_", "keys_", ")_", "\\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 ", " _", "weights_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pieces_", "._", "extend_", "(_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "weights_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "Token_", "(_", "'", "WEIGHT", "S", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "._", "extend_", "(_", "weights_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "aggregate_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "Token_", "(_", "'", "AGG", "REG", "ATE", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "._", "append_", "(_", "aggregate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "*_", "pieces_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pfa", "dd_", "(_", "self_", ",_", "name_", ",_", "*_", "values_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Add", "s", " ", "the", " ", "specified", " ", "element", "s", " ", "to", " ", "the", " ", "specified", " ", "Hyper", "Log", "Log", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "PF", "ADD", "'_", ",_", "name_", ",_", "*_", "values_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pf", "count_", "(_", "self_", ",_", "*_", "sources_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "the", " ", "approximate", "d", " ", "cardinalit", "y", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "set", " ", "observe", "d", " ", "by", " ", "the", " ", "Hyper", "Log", "Log", " ", "at", " ", "key", "(", "s", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "PF", "COUNT", "'_", ",_", "*_", "sources_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "pf", "merge_", "(_", "self_", ",_", "dest_", ",_", "*_", "sources_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Merge", " ", "N", " ", "different", " ", "Hyper", "Log", "Log", "s", " ", "int", "o", " ", "a", " ", "single", " ", "one", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "PF", "MERGE", "'_", ",_", "dest_", ",_", "*_", "sources_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hd", "el_", "(_", "self_", ",_", "name_", ",_", "*_", "keys_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Delete", " ", "``", "keys", "``", " ", "from", " ", "hash", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "HD", "EL", "'_", ",_", "name_", ",_", "*_", "keys_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hex", "ists", "_", "(_", "self_", ",_", "name_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "a", " ", "boolean", " ", "indicati", "ng", " ", "if", " ", "``", "key", "``", " ", "exist", "s", " ", "within", " ", "hash", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "HEX", "IST", "S", "'_", ",_", "name_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hge", "t_", "(_", "self_", ",_", "name_", ",_", "key_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "the", " ", "value", " ", "of", " ", "``", "key", "``", " ", "within", " ", "the", " ", "hash", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "HG", "ET", "'_", ",_", "name_", ",_", "key_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hge", "tall", "_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "a", " ", "Pyth", "on", " ", "dict", " ", "of", " ", "the", " ", "hash", "'", "s", " ", "name", "/", "value", " ", "pair", "s", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "HG", "ETA", "LL", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hin", "cr", "by_", "(_", "self_", ",_", "name_", ",_", "key_", ",_", "amount_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Increment", " ", "the", " ", "value", " ", "of", " ", "``", "key", "``", " ", "in", " ", "hash", " ", "``", "name", "``", " ", "by", " ", "``", "amo", "unt", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "HI", "NC", "RB", "Y", "'_", ",_", "name_", ",_", "key_", ",_", "amount_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hin", "cr", "by", "float_", "(_", "self_", ",_", "name_", ",_", "key_", ",_", "amount_", "=_", "1.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Increment", " ", "the", " ", "value", " ", "of", " ", "``", "key", "``", " ", "in", " ", "hash", " ", "``", "name", "``", " ", "by", " ", "float", "ing", " ", "``", "amo", "unt", "``", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "HI", "NC", "RB", "YF", "LO", "AT", "'_", ",_", "name_", ",_", "key_", ",_", "amount_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hk", "eys", "_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "the", " ", "list", " ", "of", " ", "keys", " ", "within", " ", "hash", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "HKEY", "S", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hle", "n_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "the", " ", "number", " ", "of", " ", "element", "s", " ", "in", " ", "hash", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "HL", "EN", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hse", "t_", "(_", "self_", ",_", "name_", ",_", "key_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "``", "key", "``", " ", "to", " ", "``", "value", "``", " ", "within", " ", "hash", " ", "``", "name", "``", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "1", " ", "if", " ", "HS", "ET", " ", "created", " ", "a", " ", "new", " ", "field", ",", " ", "other", "wis", "e", " ", "0", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "HS", "ET", "'_", ",_", "name_", ",_", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hse", "tn", "x_", "(_", "self_", ",_", "name_", ",_", "key_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "``", "key", "``", " ", "to", " ", "``", "value", "``", " ", "within", " ", "hash", " ", "``", "name", "``", " ", "if", " ", "``", "key", "``", " ", "doe", "s", " ", "not", "\\", "10", ";", " ", " ", " ", " ", "exist", ".", " ", " ", "Return", "s", " ", "1", " ", "if", " ", "HS", "ET", "NX", " ", "created", " ", "a", " ", "field", ",", " ", "other", "wis", "e", " ", "0.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "HS", "ET", "NX", "'_", ",_", "name_", ",_", "key_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hms", "et_", "(_", "self_", ",_", "name_", ",_", "mapping_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "key", " ", "to", " ", "value", " ", "within", " ", "hash", " ", "``", "name", "``", " ", "for", " ", "each", " ", "correspond", "ing", "\\", "10", ";", " ", " ", " ", " ", "key", " ", "and", " ", "value", " ", "from", " ", "the", " ", "``", "mapping", "``", " ", "dict", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "mapping_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Data", "Error_", "(_", "\"'", "hms", "et", "'", " ", "with", " ", "'", "mapping", "'", " ", "of", " ", "length", " ", "0", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "items_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "pair_", "in_", "iteritems_", "(_", "mapping_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "items_", "._", "extend_", "(_", "pair_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "HM", "SET", "'_", ",_", "name_", ",_", "*_", "items_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hm", "get_", "(_", "self_", ",_", "name_", ",_", "keys_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", "s", " ", "a", " ", "list", " ", "of", " ", "values", " ", "order", "ed", " ", "identi", "call", "y", " ", "to", " ", "``", "keys", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "args_", "=_", "list", "\\u", "or", "\\u", "args_", "(_", "keys_", ",_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "HM", "GET", "'_", ",_", "name_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "hva", "ls_", "(_", "self_", ",_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Return", " ", "the", " ", "list", " ", "of", " ", "values", " ", "within", " ", "hash", " ", "``", "name", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "HV", "ALS", "'_", ",_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "publish_", "(_", "self_", ",_", "channel_", ",_", "message_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Publish", " ", "``", "message", "``", " ", "on", " ", "``", "channel", "``.", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "number", " ", "of", " ", "subscribers", " ", "the", " ", "message", " ", "was", " ", "deliver", "ed", " ", "to", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "PUBLISH", "'_", ",_", "channel_", ",_", "message_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "eval_", "(_", "self_", ",_", "script_", ",_", "num", "keys_", ",_", "*_", "keys", "\\u", "and", "\\u", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Execut", "e", " ", "the", " ", "Lu", "a", " ", "``", "script", "``", ",", " ", "speci", "fy", "ing", " ", "the", " ", "``", "num", "keys", "``", " ", "the", " ", "script", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "touch", " ", "and", " ", "the", " ", "key", " ", "names", " ", "and", " ", "argu", "ment", " ", "values", " ", "in", " ", "``", "keys", "\\u", "and", "\\u", "args", "``.", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "result", " ", "of", " ", "the", " ", "script", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "In", " ", "practic", "e", ",", " ", "use", " ", "the", " ", "object", " ", "return", "ed", " ", "by", " ", "``", "register", "\\u", "script", "``.", " ", "Thi", "s", "\\", "10", ";", " ", " ", " ", " ", "function", " ", "exist", "s", " ", "pure", "ly", " ", "for", " ", "Red", "is", " ", "API", " ", "completion", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "EVAL", "'_", ",_", "script_", ",_", "num", "keys_", ",_", "*_", "keys", "\\u", "and", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "eval", "sha_", "(_", "self_", ",_", "sha_", ",_", "num", "keys_", ",_", "*_", "keys", "\\u", "and", "\\u", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Us", "e", " ", "the", " ", "``", "sha", "``", " ", "to", " ", "execute", " ", "a", " ", "Lu", "a", " ", "script", " ", "alr", "ead", "y", " ", "register", "ed", " ", "via", " ", "EVAL", "\\", "10", ";", " ", " ", " ", " ", "or", " ", "SCRIPT", " ", "LOAD", ".", " ", "Speci", "fy", " ", "the", " ", "``", "num", "keys", "``", " ", "the", " ", "script", " ", "will", " ", "touch", " ", "and", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "key", " ", "names", " ", "and", " ", "argu", "ment", " ", "values", " ", "in", " ", "``", "keys", "\\u", "and", "\\u", "args", "``.", " ", "Return", "s", " ", "the", " ", "result", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "the", " ", "script", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "In", " ", "practic", "e", ",", " ", "use", " ", "the", " ", "object", " ", "return", "ed", " ", "by", " ", "``", "register", "\\u", "script", "``.", " ", "Thi", "s", "\\", "10", ";", " ", " ", " ", " ", "function", " ", "exist", "s", " ", "pure", "ly", " ", "for", " ", "Red", "is", " ", "API", " ", "completion", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "EVAL", "SHA", "'_", ",_", "sha_", ",_", "num", "keys_", ",_", "*_", "keys", "\\u", "and", "\\u", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "script", "\\u", "exists_", "(_", "self_", ",_", "*_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Check", " ", "if", " ", "a", " ", "script", " ", "exist", "s", " ", "in", " ", "the", " ", "script", " ", "cache", " ", "by", " ", "speci", "fy", "ing", " ", "the", " ", "SHA", "s", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "each", " ", "script", " ", "as", " ", "``", "args", "``.", " ", "Return", "s", " ", "a", " ", "list", " ", "of", " ", "boolean", " ", "values", " ", "indicati", "ng", " ", "if", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "each", " ", "alr", "ead", "y", " ", "script", " ", "exist", "s", " ", "in", " ", "the", " ", "cache", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SCRIPT", " ", "EXIST", "S", "'_", ",_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "script", "\\u", "flush_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Flu", "sh", " ", "all", " ", "scripts", " ", "from", " ", "the", " ", "script", " ", "cache", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SCRIPT", " ", "FLU", "SH", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "script", "\\u", "kill_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Kill", " ", "the", " ", "currentl", "y", " ", "executi", "ng", " ", "Lu", "a", " ", "script", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SCRIPT", " ", "KILL", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "script", "\\u", "load_", "(_", "self_", ",_", "script_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Load", " ", "a", " ", "Lu", "a", " ", "``", "script", "``", " ", "int", "o", " ", "the", " ", "script", " ", "cache", ".", " ", "Return", "s", " ", "the", " ", "SHA", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SCRIPT", " ", "LOAD", "'_", ",_", "script_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Stri", "ct", "Redis_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "register", "\\u", "script_", "(_", "self_", ",_", "script_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Register", " ", "a", " ", "Lu", "a", " ", "``", "script", "``", " ", "speci", "fy", "ing", " ", "the", " ", "``", "keys", "``", " ", "it", " ", "will", " ", "touch", ".", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "Script", " ", "object", " ", "tha", "t", " ", "is", " ", "calla", "ble", " ", "and", " ", "hide", "s", " ", "the", " ", "complex", "it", "y", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "deal", " ", "with", " ", "scripts", ",", " ", "keys", ",", " ", "and", " ", "sha", "s", ".", " ", "Thi", "s", " ", "is", " ", "the", " ", "prefer", "red", " ", "way", " ", "to", " ", "work", "\\", "10", ";", " ", " ", " ", " ", "with", " ", "Lu", "a", " ", "scripts", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Script_", "(_", "self_", ",_", "script_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Redis_", "(_", "Stri", "ct", "Redis_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Prov", "ides", " ", "back", "ward", "s", " ", "compatibility", " ", "with", " ", "older", " ", "version", "s", " ", "of", " ", "redis", "-", "py", " ", "tha", "t", "\\", "10", ";", " ", " ", " ", " ", "change", "d", " ", "argu", "ment", "s", " ", "to", " ", "some", " ", "command", "s", " ", "to", " ", "be", " ", "more", " ", "Pyth", "onic", ",", " ", "sane", ",", " ", "or", " ", "by", "\\", "10", ";", " ", " ", " ", " ", "accident", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Over", "rid", "den", " ", "callbacks_", "\\u\\u\\uNL\\u\\u\\u_", "RESPONSE", "\\u", "CALL", "BACK", "S_", "=_", "dict", "\\u", "merge_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "Stri", "ct", "Redis_", "._", "RESPONSE", "\\u", "CALL", "BACK", "S_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "TTL", "'_", ":_", "lambda_", "r_", ":_", "r_", ">=_", "0_", "and_", "r_", "or_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "PT", "TL", "'_", ":_", "lambda_", "r_", ":_", "r_", ">=_", "0_", "and_", "r_", "or_", "None_", ",_", "\\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_", "[SEP]_", "class_", "Redis_", "(_", "Stri", "ct", "Redis_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "pipeline_", "(_", "self_", ",_", "transaction_", "=_", "True_", ",_", "shard", "\\u", "hint_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Return", " ", "a", " ", "new", " ", "pipeline", " ", "object", " ", "tha", "t", " ", "can", " ", "queue", " ", "multiple", " ", "command", "s", " ", "for", "\\", "10", ";", " ", " ", " ", " ", "late", "r", " ", "executi", "on", ".", " ", "``", "transaction", "``", " ", "indicat", "es", " ", "whe", "ther", " ", "all", " ", "command", "s", "\\", "10", ";", " ", " ", " ", " ", "shou", "ld", " ", "be", " ", "executed", " ", "atomi", "call", "y", ".", " ", "Ap", "art", " ", "from", " ", "mak", "ing", " ", "a", " ", "group", " ", "of", " ", "operati", "ons", "\\", "10", ";", " ", " ", " ", " ", "atomi", "c", ",", " ", "pipeline", "s", " ", "are", " ", "usef", "ul", " ", "for", " ", "reduc", "ing", " ", "the", " ", "back", "-", "and", "-", "fort", "h", " ", "overhead", "\\", "10", ";", " ", " ", " ", " ", "bet", "ween", " ", "the", " ", "client", " ", "and", " ", "server", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "Pipeline_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "connecti", "on", "\\u", "pool_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "response", "\\u", "callbacks_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "transaction_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shard", "\\u", "hint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Redis_", "(_", "Stri", "ct", "Redis_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "sete", "x_", "(_", "self_", ",_", "name_", ",_", "value_", ",_", "time_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "the", " ", "value", " ", "of", " ", "key", " ", "``", "name", "``", " ", "to", " ", "``", "value", "``", " ", "tha", "t", " ", "expir", "es", " ", "in", " ", "``", "time", "``", "\\", "10", ";", " ", " ", " ", " ", "second", "s", ".", " ", "``", "time", "``", " ", "can", " ", "be", " ", "represent", "ed", " ", "by", " ", "an", " ", "integ", "er", " ", "or", " ", "a", " ", "Pyth", "on", "\\", "10", ";", " ", " ", " ", " ", "timedelta", " ", "object", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "time_", ",_", "datetime_", "._", "timedelta_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "=_", "time_", "._", "seconds_", "+_", "time_", "._", "days_", "*_", "24_", "*_", "3600_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "SET", "EX", "'_", ",_", "name_", ",_", "time_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Redis_", "(_", "Stri", "ct", "Redis_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "lre", "m_", "(_", "self_", ",_", "name_", ",_", "value_", ",_", "num_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Remove", " ", "the", " ", "first", " ", "``", "num", "``", " ", "occurrences", " ", "of", " ", "element", "s", " ", "equal", " ", "to", " ", "``", "value", "``", "\\", "10", ";", " ", " ", " ", " ", "from", " ", "the", " ", "list", " ", "store", "d", " ", "at", " ", "``", "name", "``.", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "``", "num", "``", " ", "argu", "ment", " ", "influence", "s", " ", "the", " ", "operati", "on", " ", "in", " ", "the", " ", "follow", "ing", " ", "way", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "num", " ", ">", " ", "0", ":", " ", "Remove", " ", "element", "s", " ", "equal", " ", "to", " ", "value", " ", "movin", "g", " ", "from", " ", "head", " ", "to", " ", "tail", ".", "\\", "10", ";", " ", " ", " ", " ", "num", " ", "<", " ", "0", ":", " ", "Remove", " ", "element", "s", " ", "equal", " ", "to", " ", "value", " ", "movin", "g", " ", "from", " ", "tail", " ", "to", " ", "head", ".", "\\", "10", ";", " ", " ", " ", " ", "num", " ", "=", " ", "0", ":", " ", "Remove", " ", "all", " ", "element", "s", " ", "equal", " ", "to", " ", "value", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "LR", "EM", "'_", ",_", "name_", ",_", "num_", ",_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Redis_", "(_", "Stri", "ct", "Redis_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "zad", "d_", "(_", "self_", ",_", "name_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "NOTE", ":", " ", "The", " ", "order", " ", "of", " ", "argu", "ment", "s", " ", "differs", " ", "from", " ", "tha", "t", " ", "of", " ", "the", " ", "official", " ", "ZA", "DD", "\\", "10", ";", " ", " ", " ", " ", "command", ".", " ", "For", " ", "back", "ward", "s", " ", "compa", "tabi", "lit", "y", ",", " ", "this", " ", "method", " ", "accepts", " ", "argu", "ment", "s", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "the", " ", "form", " ", "of", " ", "name", "1", ",", " ", "score", "1", ",", " ", "name2", ",", " ", "score", "2", ",", " ", "whi", "le", " ", "the", " ", "official", " ", "Red", "is", "\\", "10", ";", " ", " ", " ", " ", "document", "s", " ", "expect", "s", " ", "score", "1", ",", " ", "name", "1", ",", " ", "score", "2", ",", " ", "name2", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "you", "'", "re", " ", "look", "ing", " ", "to", " ", "use", " ", "the", " ", "standard", " ", "synta", "x", ",", " ", "consider", " ", "usi", "ng", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "Stri", "ct", "Red", "is", " ", "class", ".", " ", "See", " ", "the", " ", "API", " ", "Reference", " ", "section", " ", "of", " ", "the", " ", "docs", " ", "for", " ", "more", "\\", "10", ";", " ", " ", " ", " ", "informati", "on", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Set", " ", "any", " ", "number", " ", "of", " ", "element", "-", "name", ",", " ", "score", " ", "pair", "s", " ", "to", " ", "the", " ", "key", " ", "``", "name", "``.", " ", "Pair", "s", "\\", "10", ";", " ", " ", " ", " ", "can", " ", "be", " ", "specified", " ", "in", " ", "two", " ", "way", "s", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "As", " ", "*", "args", ",", " ", "in", " ", "the", " ", "form", " ", "of", ":", " ", "name", "1", ",", " ", "score", "1", ",", " ", "name2", ",", " ", "score", "2", ",", " ", "...", "\\", "10", ";", " ", " ", " ", " ", "or", " ", "as", " ", "**", "kwarg", "s", ",", " ", "in", " ", "the", " ", "form", " ", "of", ":", " ", "name", "1", "=", "score", "1", ",", " ", "name2", "=", "score", "2", ",", " ", "...", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "follow", "ing", " ", "example", " ", "wou", "ld", " ", "add", " ", "four", " ", "values", " ", "to", " ", "the", " ", "'", "my", "-", "key", "'", " ", "key", ":", "\\", "10", ";", " ", " ", " ", " ", "redis", ".", "zad", "d", "('", "my", "-", "key", "',", " ", "'", "name", "1", "',", " ", "1.1", ",", " ", "'", "name2", "',", " ", "2.2", ",", " ", "name", "3", "=", "3.3", ",", " ", "name", "4", "=", "4.4", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "args_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "args_", ")_", "%_", "2_", "!=_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Red", "is", "Error_", "(_", "\"", "ZA", "DD", " ", "require", "s", " ", "an", " ", "equal", " ", "number", " ", "of", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "values", " ", "and", " ", "score", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pieces_", "._", "extend_", "(_", "reversed_", "(_", "args_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "pair_", "in_", "iteritems_", "(_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pieces_", "._", "append_", "(_", "pair_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pieces_", "._", "append_", "(_", "pair_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "ZA", "DD", "'_", ",_", "name_", ",_", "*_", "pieces_", ")_", "\\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_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Pipe", "lines", " ", "provide", " ", "a", " ", "way", " ", "to", " ", "transmit", " ", "multiple", " ", "command", "s", " ", "to", " ", "the", " ", "Red", "is", " ", "server", "\\", "10", ";", " ", " ", " ", " ", "in", " ", "one", " ", "transmission", ".", " ", " ", "Thi", "s", " ", "is", " ", "convenien", "t", " ", "for", " ", "batch", " ", "process", "ing", ",", " ", "suc", "h", " ", "as", "\\", "10", ";", " ", " ", " ", " ", "saving", " ", "all", " ", "the", " ", "values", " ", "in", " ", "a", " ", "list", " ", "to", " ", "Red", "is", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "All", " ", "command", "s", " ", "executed", " ", "within", " ", "a", " ", "pipeline", " ", "are", " ", "wrapp", "ed", " ", "with", " ", "MULTI", " ", "and", " ", "EXEC", "\\", "10", ";", " ", " ", " ", " ", "calls", ".", " ", "Thi", "s", " ", "guaran", "tee", "s", " ", "all", " ", "command", "s", " ", "executed", " ", "in", " ", "the", " ", "pipeline", " ", "will", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "executed", " ", "atomi", "call", "y", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Any", " ", "command", " ", "rais", "ing", " ", "an", " ", "exception", " ", "doe", "s", " ", "*", "not", "*", " ", "halt", " ", "the", " ", "executi", "on", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "subsequen", "t", " ", "command", "s", " ", "in", " ", "the", " ", "pipeline", ".", " ", "Ins", "tea", "d", ",", " ", "the", " ", "exception", " ", "is", " ", "cau", "ght", "\\", "10", ";", " ", " ", " ", " ", "and", " ", "its", " ", "instance", " ", "is", " ", "place", "d", " ", "int", "o", " ", "the", " ", "response", " ", "list", " ", "return", "ed", " ", "by", " ", "execute", "()", ".", "\\", "10", ";", " ", " ", " ", " ", "Code", " ", "iterati", "ng", " ", "over", " ", "the", " ", "response", " ", "list", " ", "shou", "ld", " ", "be", " ", "able", " ", "to", " ", "deal", " ", "with", " ", "an", "\\", "10", ";", " ", " ", " ", " ", "instance", " ", "of", " ", "an", " ", "exception", " ", "as", " ", "a", " ", "potenti", "al", " ", "value", ".", " ", "In", " ", "genera", "l", ",", " ", "these", " ", "will", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "Respons", "e", "Error", " ", "exception", "s", ",", " ", "suc", "h", " ", "as", " ", "tho", "se", " ", "raise", "d", " ", "whe", "n", " ", "issu", "ing", " ", "a", " ", "command", "\\", "10", ";", " ", " ", " ", " ", "on", " ", "a", " ", "key", " ", "of", " ", "a", " ", "different", " ", "datatype", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "UN", "WATCH", "\\u", "COMMANDS_", "=_", "set_", "(_", "(_", "'", "DISC", "ARD", "'_", ",_", "'", "EXEC", "'_", ",_", "'", "UN", "WATCH", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "connecti", "on", "\\u", "pool_", ",_", "response", "\\u", "callbacks_", ",_", "transaction_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shard", "\\u", "hint_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "connecti", "on", "\\u", "pool_", "=_", "connecti", "on", "\\u", "pool_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connection_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "response", "\\u", "callbacks_", "=_", "response", "\\u", "callbacks_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "transaction_", "=_", "transaction_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "shard", "\\u", "hint_", "=_", "shard", "\\u", "hint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "watch", "ing_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "enter\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "exit\\u\\u_", "(_", "self_", ",_", "exc", "\\u", "type_", ",_", "exc", "\\u", "value_", ",_", "traceback_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "reset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "del\\u\\u_", "(_", "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 ", " _", "self_", "._", "reset_", "(_", ")_", "\\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 ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "len\\u\\u_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "len_", "(_", "self_", "._", "command", "\\u", "stack_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "reset_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "command", "\\u", "stack_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "scripts_", "=_", "set_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "to", " ", "reset", " ", "the", " ", "connecti", "on", " ", "state", " ", "in", " ", "the", " ", "event", " ", "tha", "t", " ", "we", " ", "wer", "e_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "watch", "ing", " ", "something_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "watch", "ing_", "and_", "self_", "._", "connection_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "call", " ", "this", " ", "manu", "ally", " ", "sinc", "e", " ", "our", " ", "unwa", "tch", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "immediate", "\\u", "execute", "\\u", "command", " ", "method", "s", " ", "can", " ", "call", " ", "reset", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "connection_", "._", "send", "\\u", "command_", "(_", "'", "UN", "WATCH", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connection_", "._", "read", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Connect", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "discon", "nect", " ", "will", " ", "als", "o", " ", "remove", " ", "any", " ", "previ", "ous", " ", "WATCH", "es_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "connection_", "._", "disconnect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "clean", " ", "up", " ", "the", " ", "other", " ", "instance", " ", "attributes_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "watch", "ing_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "explicit", "\\u", "transaction_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "can", " ", "safe", "ly", " ", "return", " ", "the", " ", "connecti", "on", " ", "to", " ", "the", " ", "pool", " ", "here", " ", "sinc", "e", " ", "we", "'", "re_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sure", " ", "we", "'", "re", " ", "no", " ", "long", "er", " ", "WATCH", "ing", " ", "anyt", "hing_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "connection_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "connecti", "on", "\\u", "pool_", "._", "release_", "(_", "self_", "._", "connection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connection_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "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_", "multi_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Start", " ", "a", " ", "transaction", "al", " ", "block", " ", "of", " ", "the", " ", "pipeline", " ", "after", " ", "WATCH", " ", "command", "s", "\\", "10", ";", " ", " ", " ", " ", "are", " ", "issue", "d", ".", " ", "End", " ", "the", " ", "transaction", "al", " ", "block", " ", "with", " ", "`", "execute", "`.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "explicit", "\\u", "transaction_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Red", "is", "Error_", "(_", "'", "Cann", "ot", " ", "issue", " ", "nest", "ed", " ", "calls", " ", "to", " ", "MULTI", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "command", "\\u", "stack_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Red", "is", "Error_", "(_", "'", "Command", "s", " ", "with", "out", " ", "an", " ", "initial", " ", "WATCH", " ", "have", " ", "alr", "ead", "y", " ", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "bee", "n", " ", "issue", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "explicit", "\\u", "transaction_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute", "\\u", "command_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "self_", "._", "watch", "ing_", "or_", "args_", "[_", "0_", "]_", "==_", "'", "WATCH", "'_", ")_", "and_", "not_", "self_", "._", "explicit", "\\u", "transaction_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "immediate", "\\u", "execute", "\\u", "command_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "pipeline", "\\u", "execute", "\\u", "command_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "immediate", "\\u", "execute", "\\u", "command_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Execut", "e", " ", "a", " ", "command", " ", "immediate", "ly", ",", " ", "but", " ", "don", "'", "t", " ", "auto", "-", "retr", "y", " ", "on", " ", "a", "\\", "10", ";", " ", " ", " ", " ", "Connect", "ion", "Error", " ", "if", " ", "we", "'", "re", " ", "alr", "ead", "y", " ", "WATCH", "ing", " ", "a", " ", "variab", "le", ".", " ", "Us", "ed", " ", "whe", "n", "\\", "10", ";", " ", " ", " ", " ", "issu", "ing", " ", "WATCH", " ", "or", " ", "subsequen", "t", " ", "command", "s", " ", "retrie", "ving", " ", "thei", "r", " ", "values", " ", "but", " ", "bef", "ore", "\\", "10", ";", " ", " ", " ", " ", "MULTI", " ", "is", " ", "call", "ed", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "command", "\\u", "name_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "conn_", "=_", "self_", "._", "connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "this", " ", "is", " ", "the", " ", "first", " ", "call", ",", " ", "we", " ", "need", " ", "a", " ", "connection_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "conn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "=_", "self_", "._", "connecti", "on", "\\u", "pool_", "._", "get", "\\u", "connection_", "(_", "command", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "shard", "\\u", "hint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "connection_", "=_", "conn_", "\\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 ", " _", "conn_", "._", "send", "\\u", "command_", "(_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "parse", "\\u", "response_", "(_", "conn_", ",_", "command", "\\u", "name_", ",_", "**_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Connect", "ion", "Error_", ",_", "Time", "out", "Error_", ")_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "._", "disconnect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "conn_", "._", "retr", "y", "\\u", "on", "\\u", "timeout_", "and_", "isinstance_", "(_", "e_", ",_", "Time", "out", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "we", "'", "re", " ", "not", " ", "alr", "ead", "y", " ", "watch", "ing", ",", " ", "we", " ", "can", " ", "safe", "ly", " ", "retr", "y", " ", "the", " ", "command_", "\\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_", "not_", "self_", "._", "watch", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "conn_", "._", "send", "\\u", "command_", "(_", "*_", "args_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "parse", "\\u", "response_", "(_", "conn_", ",_", "command", "\\u", "name_", ",_", "**_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Connect", "ion", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "retr", "y", " ", "fail", "ed", " ", "so", " ", "clean", "up", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "._", "disconnect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "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_", "pipeline", "\\u", "execute", "\\u", "command_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Stage", " ", "a", " ", "command", " ", "to", " ", "be", " ", "executed", " ", "whe", "n", " ", "execute", "()", " ", "is", " ", "next", " ", "call", "ed", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "the", " ", "current", " ", "Pipe", "line", " ", "object", " ", "back", " ", "so", " ", "command", "s", " ", "can", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "chained", " ", "tog", "ether", ",", " ", "suc", "h", " ", "as", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "pipe", " ", "=", " ", "pipe", ".", "set", "('", "foo", "',", " ", "'", "bar", "')", ".", "incr", "('", "ba", "z", "')", ".", "dec", "r", "('", "bang", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "At", " ", "some", " ", "other", " ", "point", ",", " ", "you", " ", "can", " ", "then", " ", "run", ":", " ", "pipe", ".", "execute", "()", ",", "\\", "10", ";", " ", " ", " ", " ", "whi", "ch", " ", "will", " ", "execute", " ", "all", " ", "command", "s", " ", "queue", "d", " ", "in", " ", "the", " ", "pipe", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "command", "\\u", "stack_", "._", "append_", "(_", "(_", "args_", ",_", "options_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "execute", "\\u", "transaction_", "(_", "self_", ",_", "connection_", ",_", "commands_", ",_", "raise", "\\u", "on", "\\u", "error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmds_", "=_", "chain_", "(_", "[_", "(_", "(_", "'", "MULTI", "'_", ",_", ")_", ",_", "{_", "}_", ")_", "]_", ",_", "commands_", ",_", "[_", "(_", "(_", "'", "EXEC", "'_", ",_", ")_", ",_", "{_", "}_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "all", "\\u", "cmds_", "=_", "connection_", "._", "pack", "\\u", "commands_", "(_", "[_", "args_", "for_", "args_", ",_", "\\u_", "in_", "cmds_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connection_", "._", "send", "\\u", "pack", "ed", "\\u", "command_", "(_", "all", "\\u", "cmds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errors_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parse", " ", "off", " ", "the", " ", "response", " ", "for", " ", "MULTI", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "NOTE", ":", " ", "we", " ", "need", " ", "to", " ", "handle", " ", "Respons", "e", "Error", "s", " ", "here", " ", "and", " ", "continue_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "tha", "t", " ", "we", " ", "read", " ", "all", " ", "the", " ", "addition", "al", " ", "command", " ", "message", "s", " ", "from_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "socket_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "parse", "\\u", "response_", "(_", "connection_", ",_", "'\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Respons", "e", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "errors_", "._", "append_", "(_", "(_", "0_", ",_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "all", " ", "the", " ", "other", " ", "commands_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", ",_", "command_", "in_", "enumerate_", "(_", "commands_", ")_", ":_", "\\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_", "._", "parse", "\\u", "response_", "(_", "connection_", ",_", "'\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Respons", "e", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ex_", "=_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "annot", "ate", "\\u", "exception_", "(_", "ex_", ",_", "i_", "+_", "1_", ",_", "command_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "errors_", "._", "append_", "(_", "(_", "i_", ",_", "ex_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "parse", " ", "the", " ", "EXEC", "._", "\\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 ", " _", "response_", "=_", "self_", "._", "parse", "\\u", "response_", "(_", "connection_", ",_", "'\\u'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Exe", "c", "Abo", "rt", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "explicit", "\\u", "transaction_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "immediate", "\\u", "execute", "\\u", "command_", "(_", "'", "DISC", "ARD", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "errors_", "[_", "0_", "]_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "raise_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "response_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Watch", "Error_", "(_", "\"", "Watch", "ed", " ", "variab", "le", " ", "change", "d", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "put", " ", "any", " ", "parse", " ", "error", "s", " ", "int", "o", " ", "the", " ", "response_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", ",_", "e_", "in_", "errors_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "._", "insert_", "(_", "i_", ",_", "e_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "response_", ")_", "!=_", "len_", "(_", "commands_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "connection_", "._", "disconnect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "Respons", "e", "Error_", "(_", "\"", "Wro", "ng", " ", "number", " ", "of", " ", "response", " ", "items", " ", "from", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "pipeline", " ", "executi", "on", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "find", " ", "any", " ", "error", "s", " ", "in", " ", "the", " ", "response", " ", "and", " ", "raise", " ", "if", " ", "necessar", "y_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "raise", "\\u", "on", "\\u", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "raise", "\\u", "first", "\\u", "error_", "(_", "commands_", ",_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "We", " ", "have", " ", "to", " ", "run", " ", "response", " ", "callback", "s", " ", "manu", "ally", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "r_", ",_", "cmd_", "in_", "izip_", "(_", "response_", ",_", "commands_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "isinstance_", "(_", "r_", ",_", "Exception_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "args_", ",_", "options_", "=_", "cmd_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "command", "\\u", "name_", "=_", "args_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "command", "\\u", "name_", "in_", "self_", "._", "response", "\\u", "callbacks_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "r_", "=_", "self_", "._", "response", "\\u", "callbacks_", "[_", "command", "\\u", "name_", "]_", "(_", "r_", ",_", "**_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "data_", "._", "append_", "(_", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "data_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "execute", "\\u", "pipeline_", "(_", "self_", ",_", "connection_", ",_", "commands_", ",_", "raise", "\\u", "on", "\\u", "error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "build", " ", "up", " ", "all", " ", "command", "s", " ", "int", "o", " ", "a", " ", "single", " ", "request", " ", "to", " ", "increase", " ", "network", " ", "perf_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "all", "\\u", "cmds_", "=_", "connection_", "._", "pack", "\\u", "commands_", "(_", "[_", "args_", "for_", "args_", ",_", "\\u_", "in_", "commands_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "connection_", "._", "send", "\\u", "pack", "ed", "\\u", "command_", "(_", "all", "\\u", "cmds_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "response_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "args_", ",_", "options_", "in_", "commands_", ":_", "\\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_", "._", "append_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "parse", "\\u", "response_", "(_", "connection_", ",_", "args_", "[_", "0_", "]_", ",_", "**_", "options_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Respons", "e", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "response_", "._", "append_", "(_", "sys_", "._", "exc", "\\u", "info_", "(_", ")_", "[_", "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_", "raise", "\\u", "on", "\\u", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "raise", "\\u", "first", "\\u", "error_", "(_", "commands_", ",_", "response_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "response_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "raise", "\\u", "first", "\\u", "error_", "(_", "self_", ",_", "commands_", ",_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "i_", ",_", "r_", "in_", "enumerate_", "(_", "response_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "r_", ",_", "Respons", "e", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "annot", "ate", "\\u", "exception_", "(_", "r_", ",_", "i_", "+_", "1_", ",_", "commands_", "[_", "i_", "]_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "raise_", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "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_", "annot", "ate", "\\u", "exception_", "(_", "self_", ",_", "exception_", ",_", "number_", ",_", "command_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cmd_", "=_", "safe", "\\u", "unicode_", "(_", "'", " ", "'_", ")_", "._", "join_", "(_", "imap_", "(_", "safe", "\\u", "unicode_", ",_", "command_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "unicode_", "(_", "'", "Command", " ", "#", " ", "%", "d", " ", "(%", "s", ")", " ", "of", " ", "pipeline", " ", "caus", "ed", " ", "error", ":", " ", "%", "s", "'_", ")_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "number_", ",_", "cmd_", ",_", "safe", "\\u", "unicode_", "(_", "exception_", "._", "args_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "exception_", "._", "args_", "=_", "(_", "msg_", ",_", ")_", "+_", "exception_", "._", "args_", "[_", "1_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "parse", "\\u", "response_", "(_", "self_", ",_", "connection_", ",_", "command", "\\u", "name_", ",_", "**_", "options_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "result_", "=_", "Stri", "ct", "Redis_", "._", "parse", "\\u", "response_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", ",_", "connection_", ",_", "command", "\\u", "name_", ",_", "**_", "options_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "command", "\\u", "name_", "in_", "self_", "._", "UN", "WATCH", "\\u", "COMMANDS_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "watch", "ing_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "command", "\\u", "name_", "==_", "'", "WATCH", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "watch", "ing_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "load", "\\u", "scripts_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "sure", " ", "all", " ", "scripts", " ", "tha", "t", " ", "are", " ", "abo", "ut", " ", "to", " ", "be", " ", "run", " ", "on", " ", "this", " ", "pipeline", " ", "exist_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scripts_", "=_", "list_", "(_", "self_", "._", "scripts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "immediate", "_", "=_", "self_", "._", "immediate", "\\u", "execute", "\\u", "command_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sha", "s_", "=_", "[_", "s_", "._", "sha_", "for_", "s_", "in_", "scripts_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "can", "'", "t", " ", "use", " ", "the", " ", "normal", " ", "script", "\\u*", " ", "method", "s", " ", "bec", "aus", "e", " ", "the", "y", " ", "wou", "ld", " ", "just", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "get", " ", "buffered", " ", "in", " ", "the", " ", "pipeline", "._", "\\u\\u\\uNL\\u\\u\\u_", "exists_", "=_", "immediate", "_", "(_", "'", "SCRIPT", "'_", ",_", "'", "EXIST", "S", "'_", ",_", "*_", "sha", "s_", ",_", "**_", "{_", "'", "parse", "'_", ":_", "'", "EXIST", "S", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "all_", "(_", "exists_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "s_", ",_", "exist_", "in_", "izip_", "(_", "scripts_", ",_", "exists_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "exist_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "s_", "._", "sha_", "=_", "immediate", "_", "(_", "'", "SCRIPT", "'_", ",_", "'", "LOAD", "'_", ",_", "s_", "._", "script_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "{_", "'", "parse", "'_", ":_", "'", "LOAD", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute_", "(_", "self_", ",_", "raise", "\\u", "on", "\\u", "error_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Execut", "e", " ", "all", " ", "the", " ", "command", "s", " ", "in", " ", "the", " ", "current", " ", "pipeline", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stack_", "=_", "self_", "._", "command", "\\u", "stack_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "stack_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "scripts_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "load", "\\u", "scripts_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "transaction_", "or_", "self_", "._", "explicit", "\\u", "transaction_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "execute_", "=_", "self_", "._", "\\u", "execute", "\\u", "transaction_", "\\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 ", " _", "execute_", "=_", "self_", "._", "\\u", "execute", "\\u", "pipeline_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "conn_", "=_", "self_", "._", "connection_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "conn_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "=_", "self_", "._", "connecti", "on", "\\u", "pool_", "._", "get", "\\u", "connection_", "(_", "'", "MULTI", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "shard", "\\u", "hint_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "assign", " ", "to", " ", "self", ".", "connecti", "on", " ", "so", " ", "reset", "()", " ", "release", "s", " ", "the", " ", "connection_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "back", " ", "to", " ", "the", " ", "pool", " ", "after", " ", "we", "'", "re", " ", "done_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "connection_", "=_", "conn_", "\\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 ", " _", "return_", "execute_", "(_", "conn_", ",_", "stack_", ",_", "raise", "\\u", "on", "\\u", "error_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "(_", "Connect", "ion", "Error_", ",_", "Time", "out", "Error_", ")_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "conn_", "._", "disconnect_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "conn_", "._", "retr", "y", "\\u", "on", "\\u", "timeout_", "and_", "isinstance_", "(_", "e_", ",_", "Time", "out", "Error_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "if", " ", "we", " ", "wer", "e", " ", "watch", "ing", " ", "a", " ", "variab", "le", ",", " ", "the", " ", "watch", " ", "is", " ", "no", " ", "long", "er", " ", "valid_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sinc", "e", " ", "this", " ", "connecti", "on", " ", "has", " ", "die", "d", ".", " ", "raise", " ", "a", " ", "Watch", "Error", ",", " ", "which_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "indicat", "es", " ", "the", " ", "user", " ", "shou", "ld", " ", "retr", "y", " ", "his", " ", "transaction", ".", " ", "If", " ", "this", " ", "is", " ", "more_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "than", " ", "a", " ", "temporar", "y", " ", "fail", "ure", ",", " ", "the", " ", "WATCH", " ", "tha", "t", " ", "the", " ", "user", " ", "next", " ", "issues_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "will", " ", "fail", ",", " ", "prop", "egat", "ing", " ", "the", " ", "real", " ", "Connect", "ion", "Error_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "watch", "ing_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Watch", "Error_", "(_", "\"", "A", " ", "Connect", "ion", "Error", " ", "occure", "d", " ", "on", " ", "whi", "le", " ", "watch", "ing", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "one", " ", "or", " ", "more", " ", "keys", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "other", "wis", "e", ",", " ", "it", "'", "s", " ", "safe", " ", "to", " ", "retr", "y", " ", "sinc", "e", " ", "the", " ", "transaction", " ", "isn", "'", "t_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "predica", "ted", " ", "on", " ", "any", " ", "state_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "execute_", "(_", "conn_", ",_", "stack_", ",_", "raise", "\\u", "on", "\\u", "error_", ")_", "\\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 ", " _", "self_", "._", "reset_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "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_", "watch_", "(_", "self_", ",_", "*_", "names_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Watch", "es", " ", "the", " ", "values", " ", "at", " ", "keys", " ", "``", "names", "``\"", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "explicit", "\\u", "transaction_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Red", "is", "Error_", "(_", "'", "Cann", "ot", " ", "issue", " ", "a", " ", "WATCH", " ", "after", " ", "a", " ", "MULTI", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "WATCH", "'_", ",_", "*_", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "unwa", "tch_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Un", "watch", "es", " ", "all", " ", "previ", "ously", " ", "specified", " ", "keys", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "self_", "._", "watch", "ing_", "and_", "self_", "._", "execute", "\\u", "command_", "(_", "'", "UN", "WATCH", "'_", ")_", "or_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Base", "Pipeline_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "script", "\\u", "load", "\\u", "for", "\\u", "pipeline_", "(_", "self_", ",_", "script_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Make", " ", "sure", " ", "scripts", " ", "are", " ", "load", "ed", " ", "prior", " ", "to", " ", "pipeline", " ", "executi", "on", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "we", " ", "need", " ", "the", " ", "sha", " ", "now", " ", "so", " ", "tha", "t", " ", "Script", ".\\u", "\\u", "call", "\\u\\u", " ", "can", " ", "use", " ", "it", " ", "to", " ", "run_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "eval", "sha", "._", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "script_", "._", "sha_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "script_", "._", "sha_", "=_", "self_", "._", "immediate", "\\u", "execute", "\\u", "command_", "(_", "'", "SCRIPT", "'_", ",_", "'", "LOAD", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "script_", "._", "script_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "**_", "{_", "'", "parse", "'_", ":_", "'", "LOAD", "'_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "scripts_", "._", "add_", "(_", "script_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Stri", "ct", "Pipeline_", "(_", "Base", "Pipeline_", ",_", "Stri", "ct", "Redis_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Pipe", "line", " ", "for", " ", "the", " ", "Stri", "ct", "Red", "is", " ", "class", "\"_", "\\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_", "class_", "Pipeline_", "(_", "Base", "Pipeline_", ",_", "Redis_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"", "Pipe", "line", " ", "for", " ", "the", " ", "Red", "is", " ", "class", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 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, 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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, 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, 4, 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, 4, 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, 2 ]
Unused import
OpenMDAO/OpenMDAO-Framework/contrib/testmpi/test_mpi.py
[ { "content": "\nfrom unittest import TestCase\nimport time\n\nimport numpy as np\n\nfrom openmdao.lib.drivers.iterate import FixedPointIterator\nfrom openmdao.lib.drivers.newton_solver import NewtonSolver\nfrom openmdao.lib.optproblems import sellar\n\nfrom openmdao.main.api import Assembly, Component, set_as_top, Driver\nfrom openmdao.main.datatypes.api import Float, Array, Str, List\nfrom openmdao.main.interfaces import implements, ISolver\nfrom openmdao.main.mpiwrap import MPI, MPIContext\nfrom openmdao.main.test.simpledriver import SimpleDriver\nfrom openmdao.test.execcomp import ExecComp\nfrom openmdao.test.mpiunittest import MPITestCase\nfrom openmdao.util.testutil import assert_rel_error\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nif __name__ == '__main__':\n from openmdao.test.mpiunittest import mpirun_tests\n mpirun_tests()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class NoDerivSimpleDriver(SimpleDriver):", "metadata": "root.NoDerivSimpleDriver", "header": "['module', '___EOS___']", "index": 20 }, { "content": " def requires_derivs(self):\n return False", "metadata": "root.NoDerivSimpleDriver.requires_derivs", "header": "['class', 'NoDerivSimpleDriver', '(', 'SimpleDriver', ')', ':', '___EOS___']", "index": 21 }, { "content": "class NoDerivSimpleDriverSetter(NoDerivSimpleDriver):\n", "metadata": "root.NoDerivSimpleDriverSetter", "header": "['module', '___EOS___']", "index": 24 }, { "content": " def __init__(self, *args, **kwargs):\n super(NoDerivSimpleDriverSetter, self).__init__(*args, **kwargs)\n self.vals = []", "metadata": "root.NoDerivSimpleDriverSetter.__init__", "header": "['class', 'NoDerivSimpleDriverSetter', '(', 'NoDerivSimpleDriver', ')', ':', '___EOS___']", "index": 25 }, { "content": " def execute(self):\n self.set_parameters(self.vals)\n self.run_iteration()", "metadata": "root.NoDerivSimpleDriverSetter.execute", "header": "['class', 'NoDerivSimpleDriverSetter', '(', 'NoDerivSimpleDriver', ')', ':', '___EOS___']", "index": 29 }, { "content": "class ABCDArrayComp(Component):\n delay = Float(0.01, iotype='in')\n in_string = Str(iotype='in')\n out_string = Str(iotype='out')\n in_list = List(iotype='in')\n out_list = List(iotype='out')\n\n\n", "metadata": "root.ABCDArrayComp", "header": "['module', '___EOS___']", "index": 34 }, { "content": " def __init__(self, arr_size=9):\n super(ABCDArrayComp, self).__init__()\n self.add_trait('a', Array(np.ones(arr_size, float), iotype='in'))\n self.add_trait('b', Array(np.ones(arr_size, float), iotype='in'))\n self.add_trait('c', Array(np.ones(arr_size, float), iotype='out'))\n self.add_trait('d', Array(np.ones(arr_size, float), iotype='out'))", "metadata": "root.ABCDArrayComp.__init__", "header": "['class', 'ABCDArrayComp', '(', 'Component', ')', ':', '___EOS___']", "index": 41 }, { "content": " def execute(self):\n time.sleep(self.delay)\n self.c = self.a + self.b\n self.d = self.a - self.b\n self.out_string = self.in_string + '_' + self.name\n self.out_list = self.in_list[:]+[1.5]", "metadata": "root.ABCDArrayComp.execute", "header": "['class', 'ABCDArrayComp', '(', 'Component', ')', ':', '___EOS___']", "index": 48 }, { "content": " def dump(self, comm):\n print \"%d: %s.a = %s\" % (comm.rank, self.name, self.a)\n print \"%d: %s.b = %s\" % (comm.rank, self.name, self.b)\n print \"%d: %s.c = %s\" % (comm.rank, self.name, self.c)\n print \"%d: %s.d = %s\" % (comm.rank, self.name, self.d)", "metadata": "root.ABCDArrayComp.dump", "header": "['class', 'ABCDArrayComp', '(', 'Component', ')', ':', '___EOS___']", "index": 55 }, { "content": "class SellarMDF(Assembly):\n \"\"\" Optimization of the Sellar problem using MDF\n Disciplines coupled with FixedPointIterator.\n \"\"\"", "metadata": "root.SellarMDF", "header": "['module', '___EOS___']", "index": 61 }, { "content": " def configure(self):\n \"\"\" Creates a new Assembly with this problem\n\n Optimal Design at (1.9776, 0, 0)\n\n Optimal Objective = 3.18339\n \"\"\"\n\n self.add('driver', FixedPointIterator())\n\n # Inner Loop - Full Multidisciplinary Solve via fixed point iteration\n C1 = self.add('C1', sellar.Discipline1())\n C2 = self.add('C2', sellar.Discipline2())\n\n self.driver.workflow.add(['C1','C2'])\n\n #not relevant to the iteration. Just fixed constants\n C1.z1 = C2.z1 = 1.9776\n C1.z2 = C2.z2 = 0\n C1.x1 = 0\n\n # Solver settings\n self.driver.max_iteration = 5\n self.driver.tolerance = 1.e-15\n self.driver.print_convergence = False", "metadata": "root.SellarMDF.configure", "header": "['class', 'SellarMDF', '(', 'Assembly', ')', ':', '___EOS___']", "index": 65 }, { "content": "class SellarMDFwithDerivs(Assembly):\n \"\"\" Optimization of the Sellar problem using MDF\n Disciplines coupled with FixedPointIterator.\n \"\"\"", "metadata": "root.SellarMDFwithDerivs", "header": "['module', '___EOS___']", "index": 91 }, { "content": " def configure(self):\n \"\"\" Creates a new Assembly with this problem\n\n Optimal Design at (1.9776, 0, 0)\n\n Optimal Objective = 3.18339\n \"\"\"\n\n self.add('driver', FixedPointIterator())\n\n # Inner Loop - Full Multidisciplinary Solve via fixed point iteration\n C1 = self.add('C1', sellar.Discipline1_WithDerivatives())\n C2 = self.add('C2', sellar.Discipline2_WithDerivatives())\n\n self.driver.workflow.add(['C1','C2'])\n\n #not relevant to the iteration. Just fixed constants\n C1.z1 = C2.z1 = 1.9776\n C1.z2 = C2.z2 = 0\n C1.x1 = 0\n\n # Solver settings\n self.driver.max_iteration = 5\n self.driver.tolerance = 1.e-15\n self.driver.print_convergence = False", "metadata": "root.SellarMDFwithDerivs.configure", "header": "['class', 'SellarMDFwithDerivs', '(', 'Assembly', ')', ':', '___EOS___']", "index": 95 }, { "content": "class MPITests1(MPITestCase):\n\n N_PROCS = 2\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.MPITests1", "header": "['module', '___EOS___']", "index": 122 }, { "content": " def test_sellar_params1(self):\n top = set_as_top(SellarMDF())\n\n top.connect('C1.y1','C2.y1')\n\n top.driver.add_parameter('C1.y2', low=-1.e99, high=1.e99)\n top.driver.add_constraint('C1.y2 = C2.y2')\n\n expected = { 'C1.y1': 3.160068, 'C2.y2': 3.755315 }\n\n top.run()\n\n if self.comm.rank == 0:\n for name, expval in expected.items():\n val = top.get(name)\n assert_rel_error(self, val, expval, 0.001)", "metadata": "root.MPITests1.test_sellar_params1", "header": "['class', 'MPITests1', '(', 'MPITestCase', ')', ':', '___EOS___']", "index": 126 }, { "content": " def test_sellar_params2(self):\n top = set_as_top(SellarMDF())\n\n top.connect('C1.y1','C2.y1')\n\n top.driver.add_parameter('C1.y2', low=-1.e99, high=1.e99)\n top.driver.add_constraint('C2.y2 = C1.y2')\n\n expected = { 'C1.y1': 3.160068, 'C2.y2': 3.755315 }\n\n top.run()\n\n if self.comm.rank == 0:\n for name, expval in expected.items():\n val = top.get(name)\n assert_rel_error(self, val, expval, 0.001)", "metadata": "root.MPITests1.test_sellar_params2", "header": "['class', 'MPITests1', '(', 'MPITestCase', ')', ':', '___EOS___']", "index": 143 }, { "content": " def test_simple_opaque(self):\n size = 5\n\n # 2 parallel comps feeding another comp\n top = set_as_top(Assembly())\n top.add('driver', SimpleDriver())\n top.add(\"C1\", ABCDArrayComp(size))\n top.add(\"C2\", ABCDArrayComp(size))\n top.driver.workflow.add(['C1', 'C2'])\n top.connect('C1.c', 'C2.a')\n\n top.C1.a = np.ones(size, float) * 3.0\n top.C1.b = np.ones(size, float) * 7.0\n top.C2.b = np.ones(size, float) * 5.0\n\n top.run()\n\n if self.comm.rank == 0:\n self.assertTrue(all(top.C2.a==np.ones(size, float)*10.))\n self.assertTrue(all(top.C2.b==np.ones(size, float)*5.))\n self.assertTrue(all(top.C2.c==np.ones(size, float)*15.))\n self.assertTrue(all(top.C2.d==np.ones(size, float)*5.))", "metadata": "root.MPITests1.test_simple_opaque", "header": "['class', 'MPITests1', '(', 'MPITestCase', ')', ':', '___EOS___']", "index": 160 }, { "content": " def test_fan_in(self):\n size = 5\n\n # 2 parallel comps feeding another comp\n top = set_as_top(Assembly())\n top.add(\"C1\", ABCDArrayComp(size))\n top.add(\"C2\", ABCDArrayComp(size))\n top.add(\"C3\", ABCDArrayComp(size))\n top.driver.workflow.add(['C1', 'C2', 'C3'])\n top.connect('C1.c', 'C3.a')\n top.connect('C2.d', 'C3.b')\n\n top.C1.a = np.ones(size, float) * 3.0\n top.C1.b = np.ones(size, float) * 7.0\n top.C2.a = np.ones(size, float) * 4.0\n top.C2.b = np.ones(size, float) * 5.0\n\n top.run()\n\n self.assertTrue(all(top.C3.a==np.ones(size, float)*10.))\n self.assertTrue(all(top.C3.b==np.ones(size, float)*-1.))\n self.assertTrue(all(top.C3.c==np.ones(size, float)*9.))\n self.assertTrue(all(top.C3.d==np.ones(size, float)*11.))", "metadata": "root.MPITests1.test_fan_in", "header": "['class', 'MPITests1', '(', 'MPITestCase', ')', ':', '___EOS___']", "index": 183 }, { "content": " def test_fan_in_simpledriver(self):\n size = 5\n\n # 2 parallel comps feeding another comp\n top = set_as_top(Assembly())\n top.add('driver', SimpleDriver())\n\n top.add(\"C1\", ABCDArrayComp(size))\n top.add(\"C2\", ABCDArrayComp(size))\n top.add(\"C3\", ABCDArrayComp(size))\n top.driver.workflow.add(['C1', 'C2', 'C3'])\n top.connect('C1.c', 'C3.a')\n top.connect('C2.d', 'C3.b')\n\n top.C1.a = np.ones(size, float) * 3.0\n top.C1.b = np.ones(size, float) * 7.0\n top.C2.a = np.ones(size, float) * 4.0\n top.C2.b = np.ones(size, float) * 5.0\n\n top.driver.add_parameter('C1.a', low=-1000, high=1000)\n top.driver.add_parameter('C2.a', low=-1000, high=1000)\n top.driver.add_objective('C3.d')\n\n top.run()\n\n # top.C1.dump(self.comm)\n # top.C2.dump(self.comm)\n\n if self.comm.rank == 0:\n self.assertTrue(all(top.C3.a==np.ones(size, float)*10.))\n self.assertTrue(all(top.C3.b==np.ones(size, float)*-1.))\n self.assertTrue(all(top.C3.c==np.ones(size, float)*9.))\n self.assertTrue(all(top.C3.d==np.ones(size, float)*11.))", "metadata": "root.MPITests1.test_fan_in_simpledriver", "header": "['class', 'MPITests1', '(', 'MPITestCase', ')', ':', '___EOS___']", "index": 207 }, { "content": " def test_fan_in_simpledriver_noderiv(self):\n size = 5\n\n # 2 parallel comps feeding another comp\n top = set_as_top(Assembly())\n top.add('driver', NoDerivSimpleDriver())\n\n top.add(\"C1\", ABCDArrayComp(size))\n top.add(\"C2\", ABCDArrayComp(size))\n top.add(\"C3\", ABCDArrayComp(size))\n top.driver.workflow.add(['C1', 'C2', 'C3'])\n top.connect('C1.c', 'C3.a')\n top.connect('C2.d', 'C3.b')\n\n top.C1.a = np.ones(size, float) * 3.0\n top.C1.b = np.ones(size, float) * 7.0\n top.C2.a = np.ones(size, float) * 4.0\n top.C2.b = np.ones(size, float) * 5.0\n\n top.driver.add_parameter('C1.a', low=-1000, high=1000)\n top.driver.add_parameter('C2.a', low=-1000, high=1000)\n top.driver.add_objective('C3.d')\n\n top.run()\n\n self.assertTrue(all(top.C3.a==np.ones(size, float)*10.))\n self.assertTrue(all(top.C3.b==np.ones(size, float)*-1.))\n self.assertTrue(all(top.C3.c==np.ones(size, float)*9.))\n self.assertTrue(all(top.C3.d==np.ones(size, float)*11.))", "metadata": "root.MPITests1.test_fan_in_simpledriver_noderiv", "header": "['class', 'MPITests1', '(', 'MPITestCase', ')', ':', '___EOS___']", "index": 241 }, { "content": " def test_fan_in_simpledriver_setting_params(self):\n size = 5\n\n # 2 parallel comps feeding another comp\n top = set_as_top(Assembly())\n top.add('driver', NoDerivSimpleDriverSetter())\n\n top.add(\"C1\", ABCDArrayComp(size))\n top.add(\"C2\", ABCDArrayComp(size))\n top.add(\"C3\", ABCDArrayComp(size))\n top.driver.workflow.add(['C1', 'C2', 'C3'])\n top.connect('C1.c', 'C3.a')\n top.connect('C2.d', 'C3.b')\n\n top.C1.a = np.ones(size, float) * 3.0\n top.C1.b = np.ones(size, float) * 7.0\n top.C2.a = np.ones(size, float) * 4.0\n top.C2.b = np.ones(size, float) * 5.0\n\n top.driver.add_parameter('C1.a', low=-1000, high=1000)\n top.driver.add_parameter('C2.a', low=-1000, high=1000)\n top.driver.add_objective('C3.d')\n top.driver.vals = [-1.,-1.,-1.,-1.,-1,9.,9.,9.,9.,9.]\n\n top.run()\n\n #if self.comm.rank == 0:\n # from openmdao.util.dotgraph import plot_graph, plot_graphs, plot_system_tree\n # plot_graphs(top, prefix=\"works\")\n\n self.assertTrue(all(top.C3.a==np.ones(size, float)*6.))\n self.assertTrue(all(top.C3.b==np.ones(size, float)*4.))\n self.assertTrue(all(top.C3.c==np.ones(size, float)*10.))\n self.assertTrue(all(top.C3.d==np.ones(size, float)*2.))", "metadata": "root.MPITests1.test_fan_in_simpledriver_setting_params", "header": "['class', 'MPITests1', '(', 'MPITestCase', ')', ':', '___EOS___']", "index": 271 }, { "content": " def test_fan_out_in(self):\n size = 5 # array var size\n\n # a comp feeds two parallel comps which feed\n # another comp\n top = set_as_top(Assembly())\n top.add(\"C1\", ABCDArrayComp(size))\n top.add(\"C2\", ABCDArrayComp(size))\n top.add(\"C3\", ABCDArrayComp(size))\n top.add(\"C4\", ABCDArrayComp(size))\n top.driver.workflow.add(['C1', 'C2', 'C3', 'C4'])\n top.connect('C1.c', 'C2.a')\n top.connect('C1.d', 'C3.b')\n top.connect('C2.c', 'C4.a')\n top.connect('C3.d', 'C4.b')\n\n top.C1.a = np.ones(size, float) * 3.0\n top.C1.b = np.ones(size, float) * 7.0\n\n top.run()\n\n with MPIContext():\n self.assertTrue(all(top.C4.a==np.ones(size, float)*11.))\n self.assertTrue(all(top.C4.b==np.ones(size, float)*5.))\n\n # Piggyback testing of the is_variable_local function.\n system = top.driver.workflow._system\n\n # Only lowest rank has vars that are on all proceses\n if self.comm.rank == 0:\n self.assertTrue(system.is_variable_local('C1.c'))\n self.assertTrue(system.is_variable_local('C2.a'))\n self.assertTrue(system.is_variable_local('C3.b'))\n self.assertTrue(system.is_variable_local('C1.exec_count'))\n else:\n self.assertFalse(system.is_variable_local('C1.c'))\n self.assertFalse(system.is_variable_local('C2.a'))\n self.assertFalse(system.is_variable_local('C3.b'))\n self.assertFalse(system.is_variable_local('C1.exec_count'))\n\n # Exclusive or - you either got C2 or C3 on a given process.\n self.assertTrue(system.is_variable_local('C2.c') != system.is_variable_local('C3.d'))\n self.assertTrue(system.is_variable_local('C4.a') != system.is_variable_local('C4.b'))", "metadata": "root.MPITests1.test_fan_out_in", "header": "['class', 'MPITests1', '(', 'MPITestCase', ')', ':', '___EOS___']", "index": 307 }, { "content": " def test_fan_out_in_force_serial(self):\n size = 5 # array var size\n\n top = set_as_top(Assembly())\n top.add(\"C1\", ABCDArrayComp(size))\n top.add(\"C2\", ABCDArrayComp(size))\n top.add(\"C3\", ABCDArrayComp(size))\n top.add(\"C4\", ABCDArrayComp(size))\n top.driver.workflow.add(['C1', 'C2', 'C3', 'C4'])\n top.connect('C1.c', 'C2.a')\n top.connect('C1.d', 'C3.b')\n top.connect('C2.c', 'C4.a')\n top.connect('C3.d', 'C4.b')\n\n top.C1.a = np.ones(size, float) * 3.0\n top.C1.b = np.ones(size, float) * 7.0\n\n top.driver.system_type = 'serial'\n\n top.run()\n\n if self.comm.rank == 0:\n self.assertTrue(all(top.C4.a==np.ones(size, float)*11.))\n self.assertTrue(all(top.C4.b==np.ones(size, float)*5.))", "metadata": "root.MPITests1.test_fan_out_in_force_serial", "header": "['class', 'MPITests1', '(', 'MPITestCase', ')', ':', '___EOS___']", "index": 352 }, { "content": " def test_serial_under_par(self):\n\n class MyDriver(SimpleDriver):\n\n implements(ISolver)\n\n def execute(self):\n # Direct uvec setting\n uvec = self._system.vec['u']\n #print uvec.keys()\n # Only can interact with the var that is in our node\n for num in [1.0, 2.0, 3.0]:\n if 'comp1.x' in uvec:\n uvec['comp1.x'] = num\n #print \"SETTING\", 'comp1.x', uvec['comp1.x']\n if 'comp2.x' in uvec:\n uvec['comp2.x'] = num\n #print \"SETTING\", 'comp2.x', uvec['comp2.x']\n\n self.run_iteration()\n\n def requires_derivs(self):\n return False\n\n top = set_as_top(Assembly())\n top.add('driver', MyDriver())\n top.add('comp1', ExecComp(['y = 2.0*x']))\n top.add('comp2', ExecComp(['y = 1.0*x']))\n top.driver.workflow.add(['comp1', 'comp2'])\n top.driver.add_parameter('comp1.x', low=-100, high=100)\n top.driver.add_parameter('comp2.x', low=-100, high=100)\n top.driver.add_constraint('comp1.y = comp2.x')\n top.driver.add_constraint('comp2.y = comp1.x')\n\n top.run()\n\n self.assertTrue(top.comp1.x==3.0)\n self.assertTrue(top.comp2.x==3.0)", "metadata": "root.MPITests1.test_serial_under_par", "header": "['class', 'MPITests1', '(', 'MPITestCase', ')', ':', '___EOS___']", "index": 377 }, { "content": "class MPITests2(MPITestCase):\n\n N_PROCS = 2\n\n\n", "metadata": "root.MPITests2", "header": "['module', '___EOS___']", "index": 417 }, { "content": " def test_sellar_cyclic(self):\n\n top = set_as_top(SellarMDF())\n\n top.connect('C1.y1','C2.y1')\n top.connect('C2.y2', 'C1.y2')\n\n expected = { 'C1.y1': 3.160068, 'C2.y2': 3.755315 }\n\n top.run()\n\n if self.comm.rank == 0:\n for name, expval in expected.items():\n val = top.get(name)\n assert_rel_error(self, val, expval, 0.001)", "metadata": "root.MPITests2.test_sellar_cyclic", "header": "['class', 'MPITests2', '(', 'MPITestCase', ')', ':', '___EOS___']", "index": 421 }, { "content": " def test_sellar_parallel(self):\n\n top = set_as_top(SellarMDF())\n\n top.driver.max_iteration = 25\n top.driver.add_parameter('C2.y1', low=-1e99, high=1e99)\n top.driver.add_constraint('C1.y1 = C2.y1')\n top.driver.add_parameter('C1.y2', low=-1.e99, high=1.e99)\n top.driver.add_constraint('C2.y2 = C1.y2')\n\n expected = { 'C1.y1': 3.1598617768014536, 'C2.y2': 3.7551999159927316 }\n\n top.run()\n\n # gather the values back to the rank 0 process and compare to expected\n dist_answers = top._system.mpi.comm.gather([(k[0],v) for k,v in top._system.vec['u'].items()],\n root=0)\n if self.comm.rank == 0:\n for answers in dist_answers:\n for name, val in answers:\n if name in expected:\n #print self.comm.rank, name, val[0]\n assert_rel_error(self, val[0], expected[name], 0.001)\n del expected[name]\n\n if expected:\n self.fail(\"expected values %s were not found\" % expected.keys())\n\n # Piggyback testing of the is_variable_local function.\n system = top.driver.workflow._system\n\n # Only lowest rank has vars that are on all proceses\n if self.comm.rank == 0:\n self.assertTrue(system.is_variable_local('_pseudo_0.out0'))\n\n # Params on lowest rank\n self.assertTrue(system.is_variable_local('C1.y2'))\n self.assertTrue(system.is_variable_local('C2.y1'))\n else:\n self.assertFalse(system.is_variable_local('_pseudo_0.out0'))\n self.assertFalse(system.is_variable_local('C1.y2'))\n self.assertFalse(system.is_variable_local('C2.y1'))\n\n # Exclusive or - you either got C2 or C3 on a given process.\n self.assertTrue(system.is_variable_local('C1.y1') != system.is_variable_local('C2.y2'))\n self.assertTrue(system.is_variable_local('C1.exec_count') != system.is_variable_local('C2.exec_count'))", "metadata": "root.MPITests2.test_sellar_parallel", "header": "['class', 'MPITests2', '(', 'MPITestCase', ')', ':', '___EOS___']", "index": 437 }, { "content": " def test_sellar_Newton_parallel(self):\n\n top = set_as_top(SellarMDFwithDerivs())\n top.replace('driver', NewtonSolver())\n\n top.driver.add_parameter('C2.y1', low=-1e99, high=1e99)\n top.driver.add_constraint('C1.y1 = C2.y1')\n top.driver.add_parameter('C1.y2', low=-1.e99, high=1.e99)\n top.driver.add_constraint('C2.y2 = C1.y2')\n\n expected = { 'C1.y1': 3.1598617768014536, 'C2.y2': 3.7551999159927316 }\n\n top.driver.iprint = 0\n top.driver.max_iteration = 20\n top.run()\n # print top.C1.y1, top.C2.y1\n # print top.C1.y2, top.C2.y2\n\n # gather the values back to the rank 0 process and compare to expected\n dist_answers = top._system.mpi.comm.gather([(k[0],v) for k,v in top._system.vec['u'].items()],\n root=0)\n if self.comm.rank == 0:\n for answers in dist_answers:\n for name, val in answers:\n if name in expected:\n #print self.comm.rank, name, val[0]\n assert_rel_error(self, val[0], expected[name], 0.001)\n del expected[name]\n\n if expected:\n self.fail(\"not all expected values were found\")", "metadata": "root.MPITests2.test_sellar_Newton_parallel", "header": "['class', 'MPITests2', '(', 'MPITestCase', ')', ':', '___EOS___']", "index": 484 }, { "content": "class MPITests3(MPITestCase):\n\n N_PROCS = 3\n", "metadata": "root.MPITests3", "header": "['module', '___EOS___']", "index": 517 }, { "content": " def test_fan_out_in_noflats(self):\n size = 5 # array var size\n\n # a comp feeds 3 parallel comps which feed\n # another comp\n top = set_as_top(Assembly())\n top.add(\"C1\", ABCDArrayComp(size))\n top.add(\"C2\", ABCDArrayComp(size))\n top.add(\"C3\", ABCDArrayComp(size))\n top.add(\"C4\", ABCDArrayComp(size))\n top.add(\"C5\", ABCDArrayComp(size))\n top.driver.workflow.add(['C1', 'C2', 'C3', 'C4', 'C5'])\n top.connect('C1.c', 'C2.a')\n top.connect('C1.out_string', 'C2.in_string')\n top.connect('C1.out_list', 'C4.in_list')\n\n top.connect('C1.d', 'C3.b')\n top.connect('C1.c', 'C4.a')\n top.connect('C2.out_string', 'C5.in_string')\n top.connect('C3.d', 'C5.b')\n top.connect('C4.c', 'C5.a')\n top.connect('C4.out_list', 'C5.in_list')\n\n top.C1.a = np.ones(size, float) * 3.0\n top.C1.b = np.ones(size, float) * 7.0\n\n top.C1.in_string = 'foo'\n top.C1.in_list = [1, 1, 1]\n\n top.run()\n\n self.assertTrue(all(top.C5.a==np.ones(size, float)*11.))\n self.assertTrue(all(top.C5.b==np.ones(size, float)*5.))\n\n self.assertEqual(top.C5.out_string, 'foo_C1_C2_C5')\n self.assertEqual(top.C5.out_list, [1, 1, 1, 1.5, 1.5, 1.5])", "metadata": "root.MPITests3.test_fan_out_in_noflats", "header": "['class', 'MPITests3', '(', 'MPITestCase', ')', ':', '___EOS___']", "index": 521 }, { "content": "class TestCaseSerial(TestCase):\n", "metadata": "root.TestCaseSerial", "header": "['module', '___EOS___']", "index": 559 }, { "content": " def test_sellar_p_serial(self):\n\n top = set_as_top(SellarMDF())\n\n top.driver.add_parameter('C2.y1', low=-1e99, high=1e99)\n top.driver.add_constraint('C1.y1 = C2.y1')\n top.driver.add_parameter('C1.y2', low=-1.e99, high=1.e99)\n top.driver.add_constraint('C2.y2 = C1.y2')\n\n expected = { 'C1.y1': 3.160068, 'C2.y2': 3.755315 }\n\n top.run()\n\n #top._system.dump()\n\n #from openmdao.util.dotgraph import plot_graph, plot_system_tree\n #plot_graph(top.driver.workflow._reduced_graph, 'rgraph.pdf')\n #plot_system_tree(top._system, 'system.pdf')\n for name, expval in expected.items():\n val = top.get(name)\n assert_rel_error(self, val, expval, 0.001)", "metadata": "root.TestCaseSerial.test_sellar_p_serial", "header": "['class', 'TestCaseSerial', '(', 'TestCase', ')', ':', '___EOS___']", "index": 560 }, { "content": " def test_fan_in_simpledriver(self):\n size = 5\n\n # 2 parallel comps feeding another comp\n top = set_as_top(Assembly())\n top.add('driver', NoDerivSimpleDriver())\n\n top.add(\"C1\", ABCDArrayComp(size))\n top.add(\"C2\", ABCDArrayComp(size))\n top.add(\"C3\", ABCDArrayComp(size))\n top.driver.workflow.add(['C1', 'C2', 'C3'])\n top.connect('C1.c', 'C3.a')\n top.connect('C2.d', 'C3.b')\n\n top.C1.a = np.ones(size, float) * 3.0\n top.C1.b = np.ones(size, float) * 7.0\n top.C2.a = np.ones(size, float) * 4.0\n top.C2.b = np.ones(size, float) * 5.0\n\n top.driver.add_parameter('C1.a', low=-1000, high=1000)\n top.driver.add_objective('C3.d')\n\n top.run()\n\n self.assertTrue(all(top.C3.a==np.ones(size, float)*10.))\n self.assertTrue(all(top.C3.b==np.ones(size, float)*-1.))\n self.assertTrue(all(top.C3.c==np.ones(size, float)*9.))\n self.assertTrue(all(top.C3.d==np.ones(size, float)*11.))", "metadata": "root.TestCaseSerial.test_fan_in_simpledriver", "header": "['class', 'TestCaseSerial', '(', 'TestCase', ')', ':', '___EOS___']", "index": 582 } ]
[ { "span": "from openmdao.main.api import Assembly, Component, set_as_top, Driver", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 69 }, { "span": "from openmdao.main.mpiwrap import MPI, MPIContext", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 49 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "unittest_", "import_", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "drivers_", "._", "iterate_", "import_", "Fix", "ed", "Point", "Iterator_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "drivers_", "._", "newton", "\\u", "solver_", "import_", "New", "ton", "Solver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "lib_", "._", "opt", "problems_", "import_", "sell", "ar_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "openm", "dao_", "._", "main_", "._", "api_", "import_", "Asse", "mbly", "_", ",_", "Component_", ",_", "set\\u", "as", "\\u", "top_", ",_", "Driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "main_", "._", "datatypes_", "._", "api_", "import_", "Float_", ",_", "Array_", ",_", "Str_", ",_", "List_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "main_", "._", "interfaces_", "import_", "implements_", ",_", "IS", "olve", "r_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "main_", "._", "mpi", "wrap_", "import_", "MPI_", ",_", "MPI", "Context_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "main_", "._", "test_", "._", "simple", "driver_", "import_", "Simple", "Driver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "test_", "._", "exec", "comp_", "import_", "Exe", "c", "Comp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "test_", "._", "mpi", "unittest_", "import_", "MPI", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "openm", "dao_", "._", "util_", "._", "testu", "til_", "import_", "assert", "\\u", "rel", "\\u", "error_", "\\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\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "openm", "dao_", "._", "test_", "._", "mpi", "unittest_", "import_", "mpi", "run", "\\u", "tests_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "mpi", "run", "\\u", "tests_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "No", "Der", "iv", "Simple", "Driver_", "(_", "Simple", "Driver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "No", "Der", "iv", "Simple", "Driver_", "(_", "Simple", "Driver_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "require", "s", "\\u", "deriv", "s_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "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_", "class_", "No", "Der", "iv", "Simple", "Drive", "r", "Setter", "_", "(_", "No", "Der", "iv", "Simple", "Driver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "No", "Der", "iv", "Simple", "Drive", "r", "Setter", "_", "(_", "No", "Der", "iv", "Simple", "Driver_", ")_", ":_", "\\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_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "No", "Der", "iv", "Simple", "Drive", "r", "Setter", "_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "vals_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "No", "Der", "iv", "Simple", "Drive", "r", "Setter", "_", "(_", "No", "Der", "iv", "Simple", "Driver_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "set\\u", "parameters_", "(_", "self_", "._", "vals_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "run", "\\u", "iteration_", "(_", ")_", "\\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_", "ABC", "DA", "rray", "Comp_", "(_", "Component_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "delay_", "=_", "Float_", "(_", "0.01_", ",_", "iot", "ype_", "=_", "'", "in", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "in", "\\u", "string_", "=_", "Str_", "(_", "iot", "ype_", "=_", "'", "in", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out", "\\u", "string_", "=_", "Str_", "(_", "iot", "ype_", "=_", "'", "out", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "in", "\\u", "list_", "=_", "List_", "(_", "iot", "ype_", "=_", "'", "in", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "out", "\\u", "list_", "=_", "List_", "(_", "iot", "ype_", "=_", "'", "out", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "ABC", "DA", "rray", "Comp_", "(_", "Component_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "arr", "\\u", "size_", "=_", "9_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "ABC", "DA", "rray", "Comp_", ",_", "self_", ")_", "._", "\\u\\u", "init\\u\\u_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "trait_", "(_", "'", "a", "'_", ",_", "Array_", "(_", "np_", "._", "ones_", "(_", "arr", "\\u", "size_", ",_", "float_", ")_", ",_", "iot", "ype_", "=_", "'", "in", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "trait_", "(_", "'", "b", "'_", ",_", "Array_", "(_", "np_", "._", "ones_", "(_", "arr", "\\u", "size_", ",_", "float_", ")_", ",_", "iot", "ype_", "=_", "'", "in", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "trait_", "(_", "'", "c", "'_", ",_", "Array_", "(_", "np_", "._", "ones_", "(_", "arr", "\\u", "size_", ",_", "float_", ")_", ",_", "iot", "ype_", "=_", "'", "out", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "\\u", "trait_", "(_", "'", "d", "'_", ",_", "Array_", "(_", "np_", "._", "ones_", "(_", "arr", "\\u", "size_", ",_", "float_", ")_", ",_", "iot", "ype_", "=_", "'", "out", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ABC", "DA", "rray", "Comp_", "(_", "Component_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "execute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "time_", "._", "sleep_", "(_", "self_", "._", "delay_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "c_", "=_", "self_", "._", "a_", "+_", "self_", "._", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "d_", "=_", "self_", "._", "a_", "-_", "self_", "._", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "out", "\\u", "string_", "=_", "self_", "._", "in", "\\u", "string_", "+_", "'\\u'_", "+_", "self_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "out", "\\u", "list_", "=_", "self_", "._", "in", "\\u", "list_", "[_", ":_", "]_", "+_", "[_", "1.5_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ABC", "DA", "rray", "Comp_", "(_", "Component_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "dump_", "(_", "self_", ",_", "comm_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"%", "d", ":", " ", "%", "s", ".", "a", " ", "=", " ", "%", "s", "\"_", "%_", "(_", "comm_", "._", "rank_", ",_", "self_", "._", "name_", ",_", "self_", "._", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"%", "d", ":", " ", "%", "s", ".", "b", " ", "=", " ", "%", "s", "\"_", "%_", "(_", "comm_", "._", "rank_", ",_", "self_", "._", "name_", ",_", "self_", "._", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"%", "d", ":", " ", "%", "s", ".", "c", " ", "=", " ", "%", "s", "\"_", "%_", "(_", "comm_", "._", "rank_", ",_", "self_", "._", "name_", ",_", "self_", "._", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"%", "d", ":", " ", "%", "s", ".", "d", " ", "=", " ", "%", "s", "\"_", "%_", "(_", "comm_", "._", "rank_", ",_", "self_", "._", "name_", ",_", "self_", "._", "d_", ")_", "\\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_", "Sell", "ar", "MD", "F_", "(_", "Asse", "mbly", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Optim", "izatio", "n", " ", "of", " ", "the", " ", "Sell", "ar", " ", "problem", " ", "usi", "ng", " ", "MD", "F", "\\", "10", ";", " ", " ", " ", " ", "Disc", "ipl", "ine", "s", " ", "couple", "d", " ", "with", " ", "Fix", "ed", "Point", "Iterat", "or", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sell", "ar", "MD", "F_", "(_", "Asse", "mbly", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "configure_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Creat", "es", " ", "a", " ", "new", " ", "Asse", "mbly", " ", "with", " ", "this", " ", "problem", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Optim", "al", " ", "Desig", "n", " ", "at", " ", "(", "1.9", "776", ",", " ", "0", ",", " ", "0", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Optim", "al", " ", "Objecti", "ve", " ", "=", " ", "3.1", "833", "9", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add_", "(_", "'", "driver", "'_", ",_", "Fix", "ed", "Point", "Iterator_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "In", "ner", " ", "Loop", " ", "-", " ", "Full", " ", "Multi", "disciplin", "ary", " ", "Solve", " ", "via", " ", "fixed", " ", "point", " ", "iteration_", "\\u\\u\\uNL\\u\\u\\u_", "C1_", "=_", "self_", "._", "add_", "(_", "'", "C1", "'_", ",_", "sell", "ar_", "._", "Disc", "ipl", "ine", "1_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "C2_", "=_", "self_", "._", "add_", "(_", "'", "C2", "'_", ",_", "sell", "ar_", "._", "Disc", "ipl", "ine", "2_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "C1", "'_", ",_", "'", "C2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "not", " ", "rele", "van", "t", " ", "to", " ", "the", " ", "iterati", "on", ".", " ", "Ju", "st", " ", "fixed", " ", "constants_", "\\u\\u\\uNL\\u\\u\\u_", "C1_", "._", "z1_", "=_", "C2_", "._", "z1_", "=_", "1.9", "776", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "C1_", "._", "z2_", "=_", "C2_", "._", "z2_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "C1_", "._", "x1_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Solve", "r", " ", "settings_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "driver_", "._", "max", "\\u", "iteration_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver_", "._", "tolerance_", "=_", "1.e", "-1", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver_", "._", "print", "\\u", "convergence", "_", "=_", "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_", "class_", "Sell", "ar", "MD", "Fw", "ith", "Der", "iv", "s_", "(_", "Asse", "mbly", "_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Optim", "izatio", "n", " ", "of", " ", "the", " ", "Sell", "ar", " ", "problem", " ", "usi", "ng", " ", "MD", "F", "\\", "10", ";", " ", " ", " ", " ", "Disc", "ipl", "ine", "s", " ", "couple", "d", " ", "with", " ", "Fix", "ed", "Point", "Iterat", "or", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Sell", "ar", "MD", "Fw", "ith", "Der", "iv", "s_", "(_", "Asse", "mbly", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "configure_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Creat", "es", " ", "a", " ", "new", " ", "Asse", "mbly", " ", "with", " ", "this", " ", "problem", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Optim", "al", " ", "Desig", "n", " ", "at", " ", "(", "1.9", "776", ",", " ", "0", ",", " ", "0", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Optim", "al", " ", "Objecti", "ve", " ", "=", " ", "3.1", "833", "9", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "add_", "(_", "'", "driver", "'_", ",_", "Fix", "ed", "Point", "Iterator_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "In", "ner", " ", "Loop", " ", "-", " ", "Full", " ", "Multi", "disciplin", "ary", " ", "Solve", " ", "via", " ", "fixed", " ", "point", " ", "iteration_", "\\u\\u\\uNL\\u\\u\\u_", "C1_", "=_", "self_", "._", "add_", "(_", "'", "C1", "'_", ",_", "sell", "ar_", "._", "Disc", "ipl", "ine", "1", "\\u", "With", "Derivati", "ves_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "C2_", "=_", "self_", "._", "add_", "(_", "'", "C2", "'_", ",_", "sell", "ar_", "._", "Disc", "ipl", "ine", "2", "\\u", "With", "Derivati", "ves_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "C1", "'_", ",_", "'", "C2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "not", " ", "rele", "van", "t", " ", "to", " ", "the", " ", "iterati", "on", ".", " ", "Ju", "st", " ", "fixed", " ", "constants_", "\\u\\u\\uNL\\u\\u\\u_", "C1_", "._", "z1_", "=_", "C2_", "._", "z1_", "=_", "1.9", "776", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "C1_", "._", "z2_", "=_", "C2_", "._", "z2_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "C1_", "._", "x1_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Solve", "r", " ", "settings_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "driver_", "._", "max", "\\u", "iteration_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver_", "._", "tolerance_", "=_", "1.e", "-1", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "driver_", "._", "print", "\\u", "convergence", "_", "=_", "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_", "class_", "MPI", "Test", "s1_", "(_", "MPI", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "N", "\\u", "PROC", "S_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\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_", "[SEP]_", "class_", "MPI", "Test", "s1_", "(_", "MPI", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "sell", "ar", "\\u", "params", "1_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Sell", "ar", "MD", "F_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "y1", "'_", ",_", "'", "C2", ".", "y1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "C1", ".", "y2", "'_", ",_", "low_", "=_", "-_", "1.e", "99_", ",_", "high_", "=_", "1.e", "99_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "C1", ".", "y2", " ", "=", " ", "C2", ".", "y2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "{_", "'", "C1", ".", "y1", "'_", ":_", "3.1", "600", "68_", ",_", "'", "C2", ".", "y2", "'_", ":_", "3.7", "553", "15_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "comm_", "._", "rank_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "name_", ",_", "exp", "val_", "in_", "expected_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val_", "=_", "top_", "._", "get_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "val_", ",_", "exp", "val_", ",_", "0.001_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MPI", "Test", "s1_", "(_", "MPI", "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", "sell", "ar", "\\u", "params", "2_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Sell", "ar", "MD", "F_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "y1", "'_", ",_", "'", "C2", ".", "y1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "C1", ".", "y2", "'_", ",_", "low_", "=_", "-_", "1.e", "99_", ",_", "high_", "=_", "1.e", "99_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "C2", ".", "y2", " ", "=", " ", "C1", ".", "y2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "{_", "'", "C1", ".", "y1", "'_", ":_", "3.1", "600", "68_", ",_", "'", "C2", ".", "y2", "'_", ":_", "3.7", "553", "15_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "comm_", "._", "rank_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "name_", ",_", "exp", "val_", "in_", "expected_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val_", "=_", "top_", "._", "get_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "val_", ",_", "exp", "val_", ",_", "0.001_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MPI", "Test", "s1_", "(_", "MPI", "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", "simple", "\\u", "opaque", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", " ", "parall", "el", " ", "comps", " ", "feed", "ing", " ", "anot", "her", " ", "comp_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "driver", "'_", ",_", "Simple", "Driver_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C1", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C2", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "C1", "'_", ",_", "'", "C2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "c", "'_", ",_", "'", "C2", ".", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "C1_", "._", "a_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "3.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C1_", "._", "b_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "7.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C2_", "._", "b_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "5.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "comm_", "._", "rank_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C2_", "._", "a_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "10._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C2_", "._", "b_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "5._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C2_", "._", "c_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "15.", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C2_", "._", "d_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "5._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MPI", "Test", "s1_", "(_", "MPI", "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", "fan", "\\u", "in_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", " ", "parall", "el", " ", "comps", " ", "feed", "ing", " ", "anot", "her", " ", "comp_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C1", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C2", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C3", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "C1", "'_", ",_", "'", "C2", "'_", ",_", "'", "C3", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "c", "'_", ",_", "'", "C3", ".", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C2", ".", "d", "'_", ",_", "'", "C3", ".", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "C1_", "._", "a_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "3.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C1_", "._", "b_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "7.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C2_", "._", "a_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "4.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C2_", "._", "b_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "5.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "a_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "10._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "b_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "-_", "1._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "c_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "9._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "d_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "11.", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MPI", "Test", "s1_", "(_", "MPI", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "fan", "\\u", "in", "\\u", "simple", "driver_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", " ", "parall", "el", " ", "comps", " ", "feed", "ing", " ", "anot", "her", " ", "comp_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "driver", "'_", ",_", "Simple", "Driver_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C1", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C2", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C3", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "C1", "'_", ",_", "'", "C2", "'_", ",_", "'", "C3", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "c", "'_", ",_", "'", "C3", ".", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C2", ".", "d", "'_", ",_", "'", "C3", ".", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "C1_", "._", "a_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "3.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C1_", "._", "b_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "7.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C2_", "._", "a_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "4.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C2_", "._", "b_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "5.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "C1", ".", "a", "'_", ",_", "low_", "=_", "-_", "1000_", ",_", "high_", "=_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "C2", ".", "a", "'_", ",_", "low_", "=_", "-_", "1000_", ",_", "high_", "=_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "objective_", "(_", "'", "C3", ".", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", ".", "C1", ".", "dump", "(", "self", ".", "comm", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "top", ".", "C2", ".", "dump", "(", "self", ".", "comm", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "comm_", "._", "rank_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "a_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "10._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "b_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "-_", "1._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "c_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "9._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "d_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "11.", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MPI", "Test", "s1_", "(_", "MPI", "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", "fan", "\\u", "in", "\\u", "simple", "driver", "\\u", "node", "riv", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", " ", "parall", "el", " ", "comps", " ", "feed", "ing", " ", "anot", "her", " ", "comp_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "driver", "'_", ",_", "No", "Der", "iv", "Simple", "Driver_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C1", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C2", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C3", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "C1", "'_", ",_", "'", "C2", "'_", ",_", "'", "C3", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "c", "'_", ",_", "'", "C3", ".", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C2", ".", "d", "'_", ",_", "'", "C3", ".", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "C1_", "._", "a_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "3.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C1_", "._", "b_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "7.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C2_", "._", "a_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "4.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C2_", "._", "b_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "5.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "C1", ".", "a", "'_", ",_", "low_", "=_", "-_", "1000_", ",_", "high_", "=_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "C2", ".", "a", "'_", ",_", "low_", "=_", "-_", "1000_", ",_", "high_", "=_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "objective_", "(_", "'", "C3", ".", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "a_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "10._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "b_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "-_", "1._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "c_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "9._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "d_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "11.", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MPI", "Test", "s1_", "(_", "MPI", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "fan", "\\u", "in", "\\u", "simple", "driver", "\\u", "setti", "ng", "\\u", "params_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", " ", "parall", "el", " ", "comps", " ", "feed", "ing", " ", "anot", "her", " ", "comp_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "driver", "'_", ",_", "No", "Der", "iv", "Simple", "Drive", "r", "Setter", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C1", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C2", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C3", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "C1", "'_", ",_", "'", "C2", "'_", ",_", "'", "C3", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "c", "'_", ",_", "'", "C3", ".", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C2", ".", "d", "'_", ",_", "'", "C3", ".", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "C1_", "._", "a_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "3.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C1_", "._", "b_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "7.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C2_", "._", "a_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "4.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C2_", "._", "b_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "5.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "C1", ".", "a", "'_", ",_", "low_", "=_", "-_", "1000_", ",_", "high_", "=_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "C2", ".", "a", "'_", ",_", "low_", "=_", "-_", "1000_", ",_", "high_", "=_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "objective_", "(_", "'", "C3", ".", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "vals_", "=_", "[_", "-_", "1._", ",_", "-_", "1._", ",_", "-_", "1._", ",_", "-_", "1._", ",_", "-_", "1_", ",_", "9._", ",_", "9._", ",_", "9._", ",_", "9._", ",_", "9._", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "self", ".", "comm", ".", "rank", " ", "==", " ", "0", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "from", " ", "openm", "dao", ".", "util", ".", "dot", "graph", " ", "import", " ", "plot", "\\u", "graph", ",", " ", "plot", "\\u", "graph", "s", ",", " ", "plot", "\\u", "system", "\\u", "tree_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "plot", "\\u", "graph", "s", "(", "top", ",", " ", "prefix", "=\"", "works", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "a_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "6._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "b_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "4._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "c_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "10._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "d_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "2._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MPI", "Test", "s1_", "(_", "MPI", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "fan", "\\u", "out", "\\u", "in_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "5_", "#", " ", "array", " ", "var", " ", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "comp", " ", "feed", "s", " ", "two", " ", "parall", "el", " ", "comps", " ", "whi", "ch", " ", "feed_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "anot", "her", " ", "comp_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C1", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C2", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C3", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C4", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "C1", "'_", ",_", "'", "C2", "'_", ",_", "'", "C3", "'_", ",_", "'", "C4", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "c", "'_", ",_", "'", "C2", ".", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "d", "'_", ",_", "'", "C3", ".", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C2", ".", "c", "'_", ",_", "'", "C4", ".", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C3", ".", "d", "'_", ",_", "'", "C4", ".", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "C1_", "._", "a_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "3.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C1_", "._", "b_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "7.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "MPI", "Context_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C4", "_", "._", "a_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "11.", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C4", "_", "._", "b_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "5._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pi", "gg", "yb", "ack", " ", "testi", "ng", " ", "of", " ", "the", " ", "is", "\\u", "variab", "le", "\\u", "local", " ", "function", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "system_", "=_", "top_", "._", "driver_", "._", "workflow_", "._", "\\u", "system_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "On", "ly", " ", "lowe", "st", " ", "rank", " ", "has", " ", "vars", " ", "tha", "t", " ", "are", " ", "on", " ", "all", " ", "proce", "ses_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "comm_", "._", "rank_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C1", ".", "c", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C2", ".", "a", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C3", ".", "b", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C1", ".", "exec", "\\u", "count", "'_", ")_", ")_", "\\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", "False_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C1", ".", "c", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C2", ".", "a", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C3", ".", "b", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C1", ".", "exec", "\\u", "count", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exclu", "sive", " ", "or", " ", "-", " ", "you", " ", "eit", "her", " ", "got", " ", "C2", " ", "or", " ", "C3", " ", "on", " ", "a", " ", "give", "n", " ", "process", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C2", ".", "c", "'_", ")_", "!=_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C3", ".", "d", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C4", ".", "a", "'_", ")_", "!=_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C4", ".", "b", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MPI", "Test", "s1_", "(_", "MPI", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "fan", "\\u", "out", "\\u", "in", "\\u", "force", "\\u", "serial_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "5_", "#", " ", "array", " ", "var", " ", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C1", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C2", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C3", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C4", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "C1", "'_", ",_", "'", "C2", "'_", ",_", "'", "C3", "'_", ",_", "'", "C4", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "c", "'_", ",_", "'", "C2", ".", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "d", "'_", ",_", "'", "C3", ".", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C2", ".", "c", "'_", ",_", "'", "C4", ".", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C3", ".", "d", "'_", ",_", "'", "C4", ".", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "C1_", "._", "a_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "3.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C1_", "._", "b_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "7.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "driver_", "._", "system", "\\u", "type_", "=_", "'", "serial", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "comm_", "._", "rank_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C4", "_", "._", "a_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "11.", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C4", "_", "._", "b_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "5._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MPI", "Test", "s1_", "(_", "MPI", "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", "serial", "\\u", "under", "\\u", "par_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "class_", "My", "Driver_", "(_", "Simple", "Driver_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "implements_", "(_", "IS", "olve", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "execute_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Direct", " ", "uve", "c", " ", "setting_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "uve", "c_", "=_", "self_", "._", "\\u", "system_", "._", "vec_", "[_", "'", "u", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "uve", "c", ".", "keys", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "On", "ly", " ", "can", " ", "interact", " ", "with", " ", "the", " ", "var", " ", "tha", "t", " ", "is", " ", "in", " ", "our", " ", "node_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "num_", "in_", "[_", "1.0_", ",_", "2.0_", ",_", "3.0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "'", "comp", "1", ".", "x", "'_", "in_", "uve", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "uve", "c_", "[_", "'", "comp", "1", ".", "x", "'_", "]_", "=_", "num_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "SETTING", "\",", " ", "'", "comp", "1", ".", "x", "',", " ", "uve", "c", "['", "comp", "1", ".", "x", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "'", "comp", "2", ".", "x", "'_", "in_", "uve", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "uve", "c_", "[_", "'", "comp", "2", ".", "x", "'_", "]_", "=_", "num_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "\"", "SETTING", "\",", " ", "'", "comp", "2", ".", "x", "',", " ", "uve", "c", "['", "comp", "2", ".", "x", "']", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "run", "\\u", "iteration_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "require", "s", "\\u", "deriv", "s_", "(_", "self_", ")_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "driver", "'_", ",_", "My", "Driver_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "comp", "1", "'_", ",_", "Exe", "c", "Comp_", "(_", "[_", "'", "y", " ", "=", " ", "2.0", "*", "x", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "comp", "2", "'_", ",_", "Exe", "c", "Comp_", "(_", "[_", "'", "y", " ", "=", " ", "1.0", "*", "x", "'_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "comp", "1", "'_", ",_", "'", "comp", "2", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "comp", "1", ".", "x", "'_", ",_", "low_", "=_", "-_", "100_", ",_", "high_", "=_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "comp", "2", ".", "x", "'_", ",_", "low_", "=_", "-_", "100_", ",_", "high_", "=_", "100_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "comp", "1", ".", "y", " ", "=", " ", "comp", "2", ".", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "comp", "2", ".", "y", " ", "=", " ", "comp", "1", ".", "x", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "top_", "._", "comp", "1_", "._", "x_", "==_", "3.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "top_", "._", "comp", "2_", "._", "x_", "==_", "3.0_", ")_", "\\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_", "MPI", "Test", "s2_", "(_", "MPI", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "N", "\\u", "PROC", "S_", "=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "MPI", "Test", "s2_", "(_", "MPI", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "sell", "ar", "\\u", "cyclic", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Sell", "ar", "MD", "F_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "y1", "'_", ",_", "'", "C2", ".", "y1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C2", ".", "y2", "'_", ",_", "'", "C1", ".", "y2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "{_", "'", "C1", ".", "y1", "'_", ":_", "3.1", "600", "68_", ",_", "'", "C2", ".", "y2", "'_", ":_", "3.7", "553", "15_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "comm_", "._", "rank_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "name_", ",_", "exp", "val_", "in_", "expected_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val_", "=_", "top_", "._", "get_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "val_", ",_", "exp", "val_", ",_", "0.001_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MPI", "Test", "s2_", "(_", "MPI", "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", "sell", "ar", "\\u", "parallel_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Sell", "ar", "MD", "F_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "driver_", "._", "max", "\\u", "iteration_", "=_", "25_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "C2", ".", "y1", "'_", ",_", "low_", "=_", "-_", "1e", "99_", ",_", "high_", "=_", "1e", "99_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "C1", ".", "y1", " ", "=", " ", "C2", ".", "y1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "C1", ".", "y2", "'_", ",_", "low_", "=_", "-_", "1.e", "99_", ",_", "high_", "=_", "1.e", "99_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "C2", ".", "y2", " ", "=", " ", "C1", ".", "y2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "{_", "'", "C1", ".", "y1", "'_", ":_", "3.1", "598", "617", "768", "014", "536", "_", ",_", "'", "C2", ".", "y2", "'_", ":_", "3.7", "551", "9991", "599", "273", "16_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "gather", " ", "the", " ", "values", " ", "back", " ", "to", " ", "the", " ", "rank", " ", "0", " ", "process", " ", "and", " ", "compare", " ", "to", " ", "expected_", "\\u\\u\\uNL\\u\\u\\u_", "dist", "\\u", "answers_", "=_", "top_", "._", "\\u", "system_", "._", "mpi_", "._", "comm_", "._", "gather_", "(_", "[_", "(_", "k_", "[_", "0_", "]_", ",_", "v_", ")_", "for_", "k_", ",_", "v_", "in_", "top_", "._", "\\u", "system_", "._", "vec_", "[_", "'", "u", "'_", "]_", "._", "items_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "comm_", "._", "rank_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "answers_", "in_", "dist", "\\u", "answers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "name_", ",_", "val_", "in_", "answers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "name_", "in_", "expected_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "self", ".", "comm", ".", "rank", ",", " ", "name", ",", " ", "val", "[", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "val_", "[_", "0_", "]_", ",_", "expected_", "[_", "name_", "]_", ",_", "0.001_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "expected_", "[_", "name_", "]_", "\\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_", "expected_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "expected", " ", "values", " ", "%", "s", " ", "wer", "e", " ", "not", " ", "found", "\"_", "%_", "expected_", "._", "keys_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pi", "gg", "yb", "ack", " ", "testi", "ng", " ", "of", " ", "the", " ", "is", "\\u", "variab", "le", "\\u", "local", " ", "function", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "system_", "=_", "top_", "._", "driver_", "._", "workflow_", "._", "\\u", "system_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "On", "ly", " ", "lowe", "st", " ", "rank", " ", "has", " ", "vars", " ", "tha", "t", " ", "are", " ", "on", " ", "all", " ", "proce", "ses_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "comm_", "._", "rank_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'\\u", "pseudo", "\\u", "0.", "out", "0", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Param", "s", " ", "on", " ", "lowe", "st", " ", "rank_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C1", ".", "y2", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C2", ".", "y1", "'_", ")_", ")_", "\\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", "False_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'\\u", "pseudo", "\\u", "0.", "out", "0", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C1", ".", "y2", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C2", ".", "y1", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Exclu", "sive", " ", "or", " ", "-", " ", "you", " ", "eit", "her", " ", "got", " ", "C2", " ", "or", " ", "C3", " ", "on", " ", "a", " ", "give", "n", " ", "process", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C1", ".", "y1", "'_", ")_", "!=_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C2", ".", "y2", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C1", ".", "exec", "\\u", "count", "'_", ")_", "!=_", "system_", "._", "is", "\\u", "variab", "le", "\\u", "local_", "(_", "'", "C2", ".", "exec", "\\u", "count", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "MPI", "Test", "s2_", "(_", "MPI", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "sell", "ar", "\\u", "New", "ton", "\\u", "parallel_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Sell", "ar", "MD", "Fw", "ith", "Der", "iv", "s_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "replace_", "(_", "'", "driver", "'_", ",_", "New", "ton", "Solver_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "C2", ".", "y1", "'_", ",_", "low_", "=_", "-_", "1e", "99_", ",_", "high_", "=_", "1e", "99_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "C1", ".", "y1", " ", "=", " ", "C2", ".", "y1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "C1", ".", "y2", "'_", ",_", "low_", "=_", "-_", "1.e", "99_", ",_", "high_", "=_", "1.e", "99_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "C2", ".", "y2", " ", "=", " ", "C1", ".", "y2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "{_", "'", "C1", ".", "y1", "'_", ":_", "3.1", "598", "617", "768", "014", "536", "_", ",_", "'", "C2", ".", "y2", "'_", ":_", "3.7", "551", "9991", "599", "273", "16_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "driver_", "._", "ipr", "int_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "max", "\\u", "iteration_", "=_", "20_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "top", ".", "C1", ".", "y1", ",", " ", "top", ".", "C2", ".", "y1_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", " ", "top", ".", "C1", ".", "y2", ",", " ", "top", ".", "C2", ".", "y2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "gather", " ", "the", " ", "values", " ", "back", " ", "to", " ", "the", " ", "rank", " ", "0", " ", "process", " ", "and", " ", "compare", " ", "to", " ", "expected_", "\\u\\u\\uNL\\u\\u\\u_", "dist", "\\u", "answers_", "=_", "top_", "._", "\\u", "system_", "._", "mpi_", "._", "comm_", "._", "gather_", "(_", "[_", "(_", "k_", "[_", "0_", "]_", ",_", "v_", ")_", "for_", "k_", ",_", "v_", "in_", "top_", "._", "\\u", "system_", "._", "vec_", "[_", "'", "u", "'_", "]_", "._", "items_", "(_", ")_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "root_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "comm_", "._", "rank_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "answers_", "in_", "dist", "\\u", "answers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "name_", ",_", "val_", "in_", "answers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "name_", "in_", "expected_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "print", " ", "self", ".", "comm", ".", "rank", ",", " ", "name", ",", " ", "val", "[", "0", "]_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "val_", "[_", "0_", "]_", ",_", "expected_", "[_", "name_", "]_", ",_", "0.001_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "expected_", "[_", "name_", "]_", "\\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_", "expected_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "\"", "not", " ", "all", " ", "expected", " ", "values", " ", "wer", "e", " ", "found", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "MPI", "Test", "s3_", "(_", "MPI", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "N", "\\u", "PROC", "S_", "=_", "3_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "MPI", "Test", "s3_", "(_", "MPI", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "test\\u", "fan", "\\u", "out", "\\u", "in", "\\u", "nof", "lats_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "5_", "#", " ", "array", " ", "var", " ", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "comp", " ", "feed", "s", " ", "3", " ", "parall", "el", " ", "comps", " ", "whi", "ch", " ", "feed_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "anot", "her", " ", "comp_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C1", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C2", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C3", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C4", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C5", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "C1", "'_", ",_", "'", "C2", "'_", ",_", "'", "C3", "'_", ",_", "'", "C4", "'_", ",_", "'", "C5", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "c", "'_", ",_", "'", "C2", ".", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "out", "\\u", "string", "'_", ",_", "'", "C2", ".", "in", "\\u", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "out", "\\u", "list", "'_", ",_", "'", "C4", ".", "in", "\\u", "list", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "d", "'_", ",_", "'", "C3", ".", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "c", "'_", ",_", "'", "C4", ".", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C2", ".", "out", "\\u", "string", "'_", ",_", "'", "C5", ".", "in", "\\u", "string", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C3", ".", "d", "'_", ",_", "'", "C5", ".", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C4", ".", "c", "'_", ",_", "'", "C5", ".", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C4", ".", "out", "\\u", "list", "'_", ",_", "'", "C5", ".", "in", "\\u", "list", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "C1_", "._", "a_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "3.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C1_", "._", "b_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "7.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "C1_", "._", "in", "\\u", "string_", "=_", "'", "foo", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C1_", "._", "in", "\\u", "list_", "=_", "[_", "1_", ",_", "1_", ",_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C5", "_", "._", "a_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "11.", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C5", "_", "._", "b_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "5._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "top_", "._", "C5", "_", "._", "out", "\\u", "string_", ",_", "'", "foo", "\\u", "C1", "\\u", "C2", "\\u", "C5", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "top_", "._", "C5", "_", "._", "out", "\\u", "list_", ",_", "[_", "1_", ",_", "1_", ",_", "1_", ",_", "1.5_", ",_", "1.5_", ",_", "1.5_", "]_", ")_", "\\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", "Case", "Serial_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Case", "Serial_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test\\u", "sell", "ar", "\\u", "p", "\\u", "serial_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Sell", "ar", "MD", "F_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "C2", ".", "y1", "'_", ",_", "low_", "=_", "-_", "1e", "99_", ",_", "high_", "=_", "1e", "99_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "C1", ".", "y1", " ", "=", " ", "C2", ".", "y1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "C1", ".", "y2", "'_", ",_", "low_", "=_", "-_", "1.e", "99_", ",_", "high_", "=_", "1.e", "99_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "constraint_", "(_", "'", "C2", ".", "y2", " ", "=", " ", "C1", ".", "y2", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "expected_", "=_", "{_", "'", "C1", ".", "y1", "'_", ":_", "3.1", "600", "68_", ",_", "'", "C2", ".", "y2", "'_", ":_", "3.7", "553", "15_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "top", ".\\u", "system", ".", "dump", "()", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "from", " ", "openm", "dao", ".", "util", ".", "dot", "graph", " ", "import", " ", "plot", "\\u", "graph", ",", " ", "plot", "\\u", "system", "\\u", "tree_", "\\u\\u\\uNL\\u\\u\\u_", "#", "plot", "\\u", "graph", "(", "top", ".", "driver", ".", "workf", "low", ".\\u", "reduce", "d\\u", "graph", ",", " ", "'", "rg", "raph", ".", "pdf", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "plot", "\\u", "system", "\\u", "tree", "(", "top", ".\\u", "system", ",", " ", "'", "system", ".", "pdf", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "name_", ",_", "exp", "val_", "in_", "expected_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "val_", "=_", "top_", "._", "get_", "(_", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "val_", ",_", "exp", "val_", ",_", "0.001_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Case", "Serial_", "(_", "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", "fan", "\\u", "in", "\\u", "simple", "driver_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "size_", "=_", "5_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "2", " ", "parall", "el", " ", "comps", " ", "feed", "ing", " ", "anot", "her", " ", "comp_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Asse", "mbly", "_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "'", "driver", "'_", ",_", "No", "Der", "iv", "Simple", "Driver_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C1", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C2", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "add_", "(_", "\"", "C3", "\"_", ",_", "ABC", "DA", "rray", "Comp_", "(_", "size_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "workflow_", "._", "add_", "(_", "[_", "'", "C1", "'_", ",_", "'", "C2", "'_", ",_", "'", "C3", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C1", ".", "c", "'_", ",_", "'", "C3", ".", "a", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "connect_", "(_", "'", "C2", ".", "d", "'_", ",_", "'", "C3", ".", "b", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "C1_", "._", "a_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "3.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C1_", "._", "b_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "7.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C2_", "._", "a_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "4.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "C2_", "._", "b_", "=_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "5.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "parameter_", "(_", "'", "C1", ".", "a", "'_", ",_", "low_", "=_", "-_", "1000_", ",_", "high_", "=_", "1000_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "._", "driver_", "._", "add", "\\u", "objective_", "(_", "'", "C3", ".", "d", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "top_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "a_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "10._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "b_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "-_", "1._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "c_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "9._", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "all_", "(_", "top_", "._", "C3_", "._", "d_", "==_", "np_", "._", "ones_", "(_", "size_", ",_", "float_", ")_", "*_", "11.", "_", ")_", ")_", "\\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, 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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 ]
Unused local variable
statsmodels/statsmodels/statsmodels/tsa/statespace/tests/test_dynamic_factor.py
[ { "content": " def test_summary(self):\n summary = self.results.summary()\n tables = [str(table) for table in summary.tables]\n params = self.true['params']\n\n # Make sure we have the right number of tables\n assert_equal(len(tables), 2 + self.model.k_endog + self.model.k_factors + 1)\n\n # Check the model overview table\n assert_equal(re.search(r'Model:.*DynamicFactor\\(factors=2, order=1\\)', tables[0]) is None, False)\n\n # For each endogenous variable, check the output\n for i in range(self.model.k_endog):\n offset_loading = self.model.k_factors * i\n offset_var = self.model.k_factors * self.model.k_endog\n table = tables[i + 2]\n\n # -> Make sure we have the right table / table name\n name = self.model.endog_names[i]\n assert_equal(re.search('Results for equation %s' % name, table) is None, False)\n\n # -> Make sure it's the right size\n assert_equal(len(table.split('\\n')), 7)\n\n # -> Check that we have the right coefficients\n assert_equal(re.search('loading.f1 +' + forg(params[offset_loading + 0], prec=4), table) is None, False)\n assert_equal(re.search('loading.f2 +' + forg(params[offset_loading + 1], prec=4), table) is None, False)\n\n # For each factor, check the output\n for i in range(self.model.k_factors):\n offset = self.model.k_endog * (self.model.k_factors + 1) + i * self.model.k_factors\n table = tables[self.model.k_endog + i + 2]\n\n # -> Make sure we have the right table / table name\n name = self.model.endog_names[i]\n assert_equal(re.search('Results for factor equation f%d' % (i+1), table) is None, False)\n\n # -> Make sure it's the right size\n assert_equal(len(table.split('\\n')), 7)\n\n # -> Check that we have the right coefficients\n assert_equal(re.search('L1.f1 +' + forg(params[offset + 0], prec=4), table) is None, False)\n assert_equal(re.search('L1.f2 +' + forg(params[offset + 1], prec=4), table) is None, False)\n\n # Check the Error covariance matrix output\n table = tables[2 + self.model.k_endog + self.model.k_factors]\n\n # -> Make sure we have the right table / table name\n name = self.model.endog_names[i]\n assert_equal(re.search('Error covariance matrix', table) is None, False)\n\n # -> Make sure it's the right size\n assert_equal(len(table.split('\\n')), 8)\n\n # -> Check that we have the right coefficients\n offset = self.model.k_endog * self.model.k_factors\n for i in range(self.model.k_endog):\n assert_equal(re.search('sigma2.%s +%s' % (self.model.endog_names[i], forg(params[offset + i], prec=4)), table) is None, False)", "metadata": "root.TestDynamicFactor2.test_summary", "header": "['class', 'TestDynamicFactor2', '(', 'CheckDynamicFactor', ')', ':', '___EOS___']", "index": 187 }, { "content": " def test_summary(self):\n summary = self.results.summary()\n tables = [str(table) for table in summary.tables]\n params = self.true['params']\n\n # Make sure we have the right number of tables\n assert_equal(len(tables), 2 + self.model.k_endog + self.model.k_factors + 1)\n\n # Check the model overview table\n assert_equal(re.search(r'Model:.*DynamicFactor\\(factors=1, order=1\\)', tables[0]) is None, False)\n assert_equal(re.search(r'.*2 regressors', tables[0]) is None, False)\n\n # For each endogenous variable, check the output\n for i in range(self.model.k_endog):\n offset_loading = self.model.k_factors * i\n offset_exog = self.model.k_factors * self.model.k_endog\n table = tables[i + 2]\n\n # -> Make sure we have the right table / table name\n name = self.model.endog_names[i]\n assert_equal(re.search('Results for equation %s' % name, table) is None, False)\n\n # -> Make sure it's the right size\n assert_equal(len(table.split('\\n')), 8)\n\n # -> Check that we have the right coefficients\n assert_equal(re.search('loading.f1 +' + forg(params[offset_loading + 0], prec=4), table) is None, False)\n assert_equal(re.search('beta.const +' + forg(params[offset_exog + i*2 + 0], prec=4), table) is None, False)\n assert_equal(re.search('beta.x1 +' + forg(params[offset_exog + i*2 + 1], prec=4), table) is None, False)\n\n # For each factor, check the output\n for i in range(self.model.k_factors):\n offset = self.model.k_endog * (self.model.k_factors + 3) + i * self.model.k_factors\n table = tables[self.model.k_endog + i + 2]\n\n # -> Make sure we have the right table / table name\n name = self.model.endog_names[i]\n assert_equal(re.search('Results for factor equation f%d' % (i+1), table) is None, False)\n\n # -> Make sure it's the right size\n assert_equal(len(table.split('\\n')), 6)\n\n # -> Check that we have the right coefficients\n assert_equal(re.search('L1.f1 +' + forg(params[offset + 0], prec=4), table) is None, False)\n\n # Check the Error covariance matrix output\n table = tables[2 + self.model.k_endog + self.model.k_factors]\n\n # -> Make sure we have the right table / table name\n name = self.model.endog_names[i]\n assert_equal(re.search('Error covariance matrix', table) is None, False)\n\n # -> Make sure it's the right size\n assert_equal(len(table.split('\\n')), 8)\n\n # -> Check that we have the right coefficients\n offset = self.model.k_endog * (self.model.k_factors + 2)\n for i in range(self.model.k_endog):\n assert_equal(re.search('sigma2.%s +%s' % (self.model.endog_names[i], forg(params[offset + i], prec=4)), table) is None, False)", "metadata": "root.TestDynamicFactor_exog2.test_summary", "header": "['class', 'TestDynamicFactor_exog2', '(', 'CheckDynamicFactor', ')', ':', '___EOS___']", "index": 297 }, { "content": " def test_summary(self):\n summary = self.results.summary()\n tables = [str(table) for table in summary.tables]\n params = self.true['params']\n\n # Make sure we have the right number of tables\n assert_equal(len(tables), 2 + self.model.k_endog + self.model.k_factors + self.model.k_endog + 1)\n\n # Check the model overview table\n assert_equal(re.search(r'Model:.*DynamicFactor\\(factors=1, order=1\\)', tables[0]) is None, False)\n assert_equal(re.search(r'.*VAR\\(1\\) errors', tables[0]) is None, False)\n\n # For each endogenous variable, check the output\n for i in range(self.model.k_endog):\n offset_loading = self.model.k_factors * i\n table = tables[i + 2]\n\n # -> Make sure we have the right table / table name\n name = self.model.endog_names[i]\n assert_equal(re.search('Results for equation %s' % name, table) is None, False)\n\n # -> Make sure it's the right size\n assert_equal(len(table.split('\\n')), 6)\n\n # -> Check that we have the right coefficients\n assert_equal(re.search('loading.f1 +' + forg(params[offset_loading + 0], prec=4), table) is None, False)\n\n # For each factor, check the output\n for i in range(self.model.k_factors):\n offset = self.model.k_endog * self.model.k_factors + 6 + i * self.model.k_factors\n table = tables[2 + self.model.k_endog + i]\n\n # -> Make sure we have the right table / table name\n name = self.model.endog_names[i]\n assert_equal(re.search('Results for factor equation f%d' % (i+1), table) is None, False)\n\n # -> Make sure it's the right size\n assert_equal(len(table.split('\\n')), 6)\n\n # -> Check that we have the right coefficients\n assert_equal(re.search('L1.f1 +' + forg(params[offset + 0], prec=4), table) is None, False)\n\n # For each error equation, check the output\n for i in range(self.model.k_endog):\n offset = self.model.k_endog * (self.model.k_factors + i) + 6 + self.model.k_factors\n table = tables[2 + self.model.k_endog + self.model.k_factors + i]\n\n # -> Make sure we have the right table / table name\n name = self.model.endog_names[i]\n assert_equal(re.search('Results for error equation e\\(%s\\)' % name, table) is None, False)\n\n # -> Make sure it's the right size\n assert_equal(len(table.split('\\n')), 8)\n\n # -> Check that we have the right coefficients\n for j in range(self.model.k_endog):\n name = self.model.endog_names[j]\n assert_equal(re.search('L1.e\\(%s\\) +%s' % (name, forg(params[offset + j], prec=4)), table) is None, False)\n\n # Check the Error covariance matrix output\n table = tables[2 + self.model.k_endog + self.model.k_factors + self.model.k_endog]\n\n # -> Make sure we have the right table / table name\n name = self.model.endog_names[i]\n assert_equal(re.search('Error covariance matrix', table) is None, False)\n\n # -> Make sure it's the right size\n assert_equal(len(table.split('\\n')), 11)\n\n # -> Check that we have the right coefficients\n offset = self.model.k_endog * self.model.k_factors\n assert_equal(re.search('sqrt.var.dln_inv +' + forg(params[offset + 0], prec=4), table) is None, False)\n assert_equal(re.search('sqrt.cov.dln_inv.dln_inc +' + forg(params[offset + 1], prec=4), table) is None, False)\n assert_equal(re.search('sqrt.var.dln_inc +' + forg(params[offset + 2], prec=4), table) is None, False)\n assert_equal(re.search('sqrt.cov.dln_inv.dln_consump +' + forg(params[offset + 3], prec=4), table) is None, False)\n assert_equal(re.search('sqrt.cov.dln_inc.dln_consump +' + forg(params[offset + 4], prec=4), table) is None, False)\n assert_equal(re.search('sqrt.var.dln_consump +' + forg(params[offset + 5], prec=4), table) is None, False)", "metadata": "root.TestDynamicFactor_general_errors.test_summary", "header": "['class', 'TestDynamicFactor_general_errors', '(', 'CheckDynamicFactor', ')', ':', '___EOS___']", "index": 398 } ]
[ { "span": "offset_var ", "start_line": 201, "start_column": 12, "end_line": 201, "end_column": 22 }, { "span": "name ", "start_line": 235, "start_column": 8, "end_line": 235, "end_column": 12 }, { "span": "name ", "start_line": 346, "start_column": 8, "end_line": 346, "end_column": 12 }, { "span": "name ", "start_line": 461, "start_column": 8, "end_line": 461, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Test", "Dynamic", "Factor", "2_", "(_", "Check", "Dynamic", "Factor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "summary_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "summary_", "=_", "self_", "._", "results_", "._", "summary_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tables_", "=_", "[_", "str_", "(_", "table_", ")_", "for_", "table_", "in_", "summary_", "._", "tables_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "self_", "._", "true_", "[_", "'", "params", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "we", " ", "have", " ", "the", " ", "right", " ", "number", " ", "of", " ", "tables_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "len_", "(_", "tables_", ")_", ",_", "2_", "+_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "+_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "the", " ", "model", " ", "over", "view", " ", "table_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "r", "'", "Model", ":.", "*", "Dynamic", "Factor", "\\\\(", "factor", "s", "=", "2", ",", " ", "order", "=", "1", "\\\\)", "'_", ",_", "tables_", "[_", "0_", "]_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "each", " ", "endo", "geno", "us", " ", "variab", "le", ",", " ", "check", " ", "the", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset", "\\u", "loading_", "=_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "*_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset", "\\u", "var_", "=_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "*_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "=_", "tables_", "[_", "i_", "+_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "we", " ", "have", " ", "the", " ", "right", " ", "table", " ", "/", " ", "table", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "model_", "._", "endo", "g", "\\u", "names_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "Result", "s", " ", "for", " ", "equation", " ", "%", "s", "'_", "%_", "name_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "it", "'", "s", " ", "the", " ", "right", " ", "size_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "len_", "(_", "table_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ")_", ",_", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Check", " ", "tha", "t", " ", "we", " ", "have", " ", "the", " ", "right", " ", "coefficients_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "load", "ing", ".", "f1", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset", "\\u", "loading_", "+_", "0_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "load", "ing", ".", "f2", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset", "\\u", "loading_", "+_", "1_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "each", " ", "factor", ",", " ", "check", " ", "the", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "model_", "._", "k", "\\u", "factors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset_", "=_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "*_", "(_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "+_", "1_", ")_", "+_", "i_", "*_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "=_", "tables_", "[_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "+_", "i_", "+_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "we", " ", "have", " ", "the", " ", "right", " ", "table", " ", "/", " ", "table", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "model_", "._", "endo", "g", "\\u", "names_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "Result", "s", " ", "for", " ", "factor", " ", "equation", " ", "f", "%", "d", "'_", "%_", "(_", "i_", "+_", "1_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "it", "'", "s", " ", "the", " ", "right", " ", "size_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "len_", "(_", "table_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ")_", ",_", "7_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Check", " ", "tha", "t", " ", "we", " ", "have", " ", "the", " ", "right", " ", "coefficients_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "L1", ".", "f1", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset_", "+_", "0_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "L1", ".", "f2", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset_", "+_", "1_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "the", " ", "Error", " ", "covariance", " ", "matrix", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "table_", "=_", "tables_", "[_", "2_", "+_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "+_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "we", " ", "have", " ", "the", " ", "right", " ", "table", " ", "/", " ", "table", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "model_", "._", "endo", "g", "\\u", "names_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "Error", " ", "covariance", " ", "matrix", "'_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "it", "'", "s", " ", "the", " ", "right", " ", "size_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "len_", "(_", "table_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ")_", ",_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Check", " ", "tha", "t", " ", "we", " ", "have", " ", "the", " ", "right", " ", "coefficients_", "\\u\\u\\uNL\\u\\u\\u_", "offset_", "=_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "*_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "sigma", "2", ".", "%", "s", " ", "+", "%", "s", "'_", "%_", "(_", "self_", "._", "model_", "._", "endo", "g", "\\u", "names_", "[_", "i_", "]_", ",_", "for", "g_", "(_", "params_", "[_", "offset_", "+_", "i_", "]_", ",_", "prec_", "=_", "4_", ")_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Dynamic", "Factor", "\\u", "exo", "g2_", "(_", "Check", "Dynamic", "Factor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "summary_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "summary_", "=_", "self_", "._", "results_", "._", "summary_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tables_", "=_", "[_", "str_", "(_", "table_", ")_", "for_", "table_", "in_", "summary_", "._", "tables_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "self_", "._", "true_", "[_", "'", "params", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "we", " ", "have", " ", "the", " ", "right", " ", "number", " ", "of", " ", "tables_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "len_", "(_", "tables_", ")_", ",_", "2_", "+_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "+_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "the", " ", "model", " ", "over", "view", " ", "table_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "r", "'", "Model", ":.", "*", "Dynamic", "Factor", "\\\\(", "factor", "s", "=", "1", ",", " ", "order", "=", "1", "\\\\)", "'_", ",_", "tables_", "[_", "0_", "]_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "r", "'.*", "2", " ", "regressor", "s", "'_", ",_", "tables_", "[_", "0_", "]_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "each", " ", "endo", "geno", "us", " ", "variab", "le", ",", " ", "check", " ", "the", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset", "\\u", "loading_", "=_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "*_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "offset", "\\u", "exo", "g_", "=_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "*_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "=_", "tables_", "[_", "i_", "+_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "we", " ", "have", " ", "the", " ", "right", " ", "table", " ", "/", " ", "table", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "model_", "._", "endo", "g", "\\u", "names_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "Result", "s", " ", "for", " ", "equation", " ", "%", "s", "'_", "%_", "name_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "it", "'", "s", " ", "the", " ", "right", " ", "size_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "len_", "(_", "table_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ")_", ",_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Check", " ", "tha", "t", " ", "we", " ", "have", " ", "the", " ", "right", " ", "coefficients_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "load", "ing", ".", "f1", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset", "\\u", "loading_", "+_", "0_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "beta", ".", "const", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset", "\\u", "exo", "g_", "+_", "i_", "*_", "2_", "+_", "0_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "beta", ".", "x1", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset", "\\u", "exo", "g_", "+_", "i_", "*_", "2_", "+_", "1_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "each", " ", "factor", ",", " ", "check", " ", "the", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "model_", "._", "k", "\\u", "factors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset_", "=_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "*_", "(_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "+_", "3_", ")_", "+_", "i_", "*_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "=_", "tables_", "[_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "+_", "i_", "+_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "we", " ", "have", " ", "the", " ", "right", " ", "table", " ", "/", " ", "table", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "model_", "._", "endo", "g", "\\u", "names_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "Result", "s", " ", "for", " ", "factor", " ", "equation", " ", "f", "%", "d", "'_", "%_", "(_", "i_", "+_", "1_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "it", "'", "s", " ", "the", " ", "right", " ", "size_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "len_", "(_", "table_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ")_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Check", " ", "tha", "t", " ", "we", " ", "have", " ", "the", " ", "right", " ", "coefficients_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "L1", ".", "f1", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset_", "+_", "0_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "the", " ", "Error", " ", "covariance", " ", "matrix", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "table_", "=_", "tables_", "[_", "2_", "+_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "+_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "we", " ", "have", " ", "the", " ", "right", " ", "table", " ", "/", " ", "table", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "model_", "._", "endo", "g", "\\u", "names_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "Error", " ", "covariance", " ", "matrix", "'_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "it", "'", "s", " ", "the", " ", "right", " ", "size_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "len_", "(_", "table_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ")_", ",_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Check", " ", "tha", "t", " ", "we", " ", "have", " ", "the", " ", "right", " ", "coefficients_", "\\u\\u\\uNL\\u\\u\\u_", "offset_", "=_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "*_", "(_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "+_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "sigma", "2", ".", "%", "s", " ", "+", "%", "s", "'_", "%_", "(_", "self_", "._", "model_", "._", "endo", "g", "\\u", "names_", "[_", "i_", "]_", ",_", "for", "g_", "(_", "params_", "[_", "offset_", "+_", "i_", "]_", ",_", "prec_", "=_", "4_", ")_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Dynamic", "Factor", "\\u", "genera", "l\\u", "errors_", "(_", "Check", "Dynamic", "Factor_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "summary_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "summary_", "=_", "self_", "._", "results_", "._", "summary_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tables_", "=_", "[_", "str_", "(_", "table_", ")_", "for_", "table_", "in_", "summary_", "._", "tables_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "=_", "self_", "._", "true_", "[_", "'", "params", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Make", " ", "sure", " ", "we", " ", "have", " ", "the", " ", "right", " ", "number", " ", "of", " ", "tables_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "len_", "(_", "tables_", ")_", ",_", "2_", "+_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "+_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "+_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "+_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "the", " ", "model", " ", "over", "view", " ", "table_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "r", "'", "Model", ":.", "*", "Dynamic", "Factor", "\\\\(", "factor", "s", "=", "1", ",", " ", "order", "=", "1", "\\\\)", "'_", ",_", "tables_", "[_", "0_", "]_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "r", "'.*", "VAR", "\\\\(", "1", "\\\\)", " ", "error", "s", "'_", ",_", "tables_", "[_", "0_", "]_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "each", " ", "endo", "geno", "us", " ", "variab", "le", ",", " ", "check", " ", "the", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset", "\\u", "loading_", "=_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "*_", "i_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "=_", "tables_", "[_", "i_", "+_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "we", " ", "have", " ", "the", " ", "right", " ", "table", " ", "/", " ", "table", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "model_", "._", "endo", "g", "\\u", "names_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "Result", "s", " ", "for", " ", "equation", " ", "%", "s", "'_", "%_", "name_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "it", "'", "s", " ", "the", " ", "right", " ", "size_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "len_", "(_", "table_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ")_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Check", " ", "tha", "t", " ", "we", " ", "have", " ", "the", " ", "right", " ", "coefficients_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "load", "ing", ".", "f1", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset", "\\u", "loading_", "+_", "0_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "each", " ", "factor", ",", " ", "check", " ", "the", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "model_", "._", "k", "\\u", "factors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset_", "=_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "*_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "+_", "6_", "+_", "i_", "*_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "=_", "tables_", "[_", "2_", "+_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "+_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "we", " ", "have", " ", "the", " ", "right", " ", "table", " ", "/", " ", "table", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "model_", "._", "endo", "g", "\\u", "names_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "Result", "s", " ", "for", " ", "factor", " ", "equation", " ", "f", "%", "d", "'_", "%_", "(_", "i_", "+_", "1_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "it", "'", "s", " ", "the", " ", "right", " ", "size_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "len_", "(_", "table_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ")_", ",_", "6_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Check", " ", "tha", "t", " ", "we", " ", "have", " ", "the", " ", "right", " ", "coefficients_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "L1", ".", "f1", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset_", "+_", "0_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "each", " ", "error", " ", "equation", ",", " ", "check", " ", "the", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "i_", "in_", "range_", "(_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "offset_", "=_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "*_", "(_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "+_", "i_", ")_", "+_", "6_", "+_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "table_", "=_", "tables_", "[_", "2_", "+_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "+_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "+_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "we", " ", "have", " ", "the", " ", "right", " ", "table", " ", "/", " ", "table", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "model_", "._", "endo", "g", "\\u", "names_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "Result", "s", " ", "for", " ", "error", " ", "equation", " ", "e", "\\\\(", "%", "s", "\\\\)", "'_", "%_", "name_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "it", "'", "s", " ", "the", " ", "right", " ", "size_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "len_", "(_", "table_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ")_", ",_", "8_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Check", " ", "tha", "t", " ", "we", " ", "have", " ", "the", " ", "right", " ", "coefficients_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "j_", "in_", "range_", "(_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "name_", "=_", "self_", "._", "model_", "._", "endo", "g", "\\u", "names_", "[_", "j_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "L1", ".", "e", "\\\\(", "%", "s", "\\\\)", " ", "+", "%", "s", "'_", "%_", "(_", "name_", ",_", "for", "g_", "(_", "params_", "[_", "offset_", "+_", "j_", "]_", ",_", "prec_", "=_", "4_", ")_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "the", " ", "Error", " ", "covariance", " ", "matrix", " ", "output_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "table_", "=_", "tables_", "[_", "2_", "+_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "+_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "+_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "we", " ", "have", " ", "the", " ", "right", " ", "table", " ", "/", " ", "table", " ", "name_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "self_", "._", "model_", "._", "endo", "g", "\\u", "names_", "[_", "i_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "Error", " ", "covariance", " ", "matrix", "'_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Make", " ", "sure", " ", "it", "'", "s", " ", "the", " ", "right", " ", "size_", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "len_", "(_", "table_", "._", "split_", "(_", "'\\\\", "n", "'_", ")_", ")_", ",_", "11_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "->", " ", "Check", " ", "tha", "t", " ", "we", " ", "have", " ", "the", " ", "right", " ", "coefficients_", "\\u\\u\\uNL\\u\\u\\u_", "offset_", "=_", "self_", "._", "model_", "._", "k", "\\u", "endo", "g_", "*_", "self_", "._", "model_", "._", "k", "\\u", "factors_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "sqrt", ".", "var", ".", "dl", "n", "\\u", "inv", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset_", "+_", "0_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "sqrt", ".", "cov", ".", "dl", "n", "\\u", "inv", ".", "dl", "n", "\\u", "inc", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset_", "+_", "1_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "sqrt", ".", "var", ".", "dl", "n", "\\u", "inc", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset_", "+_", "2_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "sqrt", ".", "cov", ".", "dl", "n", "\\u", "inv", ".", "dl", "n", "\\u", "consum", "p", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset_", "+_", "3_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "sqrt", ".", "cov", ".", "dl", "n", "\\u", "inc", ".", "dl", "n", "\\u", "consum", "p", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset_", "+_", "4_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "equal_", "(_", "re_", "._", "search_", "(_", "'", "sqrt", ".", "var", ".", "dl", "n", "\\u", "consum", "p", " ", "+'_", "+_", "for", "g_", "(_", "params_", "[_", "offset_", "+_", "5_", "]_", ",_", "prec_", "=_", "4_", ")_", ",_", "table_", ")_", "is_", "None_", ",_", "False_", ")_", "\\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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ntegrateTime(self, new_pos, log=False):\n \"\"\"Integrates time by movement along the linear path defined by the\n vector between self._last_pos and new_pos.\n\n - 'm': slope of line from self._last_pos to new_pos.\n - 'a': max rate of change (self._roc_max) is (max - min seconds) / screen height\n - 'b': rate of change slope (self._roc_slope)\n - 'c': last Y position (self._last_pos[1])\n - 'd': exponent in an inverse exponential curve from max roc to min roc\n \"\"\"\n x_delta = float(new_pos[0] - self._last_pos[0])\n y_delta = (new_pos[1] - self._last_pos[1])\n if y_delta == 0.0:\n return 0.0 # no integration necessary\n m = x_delta / y_delta\n a = self._roc_max\n b = self._roc_slope\n c = float(self._last_pos[1])\n\n def _ComputeIntegral(y):\n return 0.5 * y * (2*a + b*(2*self._last_pos[0] + m*(y-2*self._last_pos[1])))\n\n if log:\n max_diff = (new_pos[1] - self._last_pos[1]) * (self._roc_max + self._roc_slope * min(new_pos[0], self._last_pos[0]))\n print 'max interval: %.2f' % (self._max_time - self._min_time)\n print 'x delta: %.2f, y delta: %.2f, slope: %.2f' % (x_delta, y_delta, 1/m)\n print 'max difference allowed: %.2f' % max_diff\n print 'integral at new pos: %.2f' % _ComputeIntegral(new_pos[1])\n print 'integral at old pos: %.2f' % _ComputeIntegral(self._last_pos[1])\n print 'integrated difference: %.2f' % (_ComputeIntegral(new_pos[1]) - _ComputeIntegral(self._last_pos[1]))\n\n return _ComputeIntegral(new_pos[1]) - _ComputeIntegral(self._last_pos[1])", "metadata": "root.VFTime._IntegrateTime", "header": "['class', 'VFTime', '(', 'object', ')', ':', '___EOS___']", "index": 137 }, { "content": "def DrawGuides(vf_time):\n \"\"\"Draws guides showing the currently displayed interval at scale on\n the right side of the screen. Also draw a line backwards from the\n current time to the corresponding time on the right side interval.\n \"\"\"\n pos = vf_time.GetPos()\n cur_time = vf_time.GetTime()\n interval = vf_time.GetInterval()\n interval_size = interval[1] - interval[0]\n max_interval = vf_time.GetMaxInterval()\n max_interval_size = max_interval[1] - max_interval[0]\n\n def _DrawGuideLine(timestamp, fmt, transparency=0.0):\n \"\"\"Draws a guide line from current interval at 'timestamp' to the max\n interval.\n \"\"\"\n left_ratio = float(timestamp - interval[0]) / interval_size\n left_y = int(iphone_dims[1] * (1.0 - left_ratio))\n right_ratio = float(timestamp - max_interval[0]) / (max_interval[1] - max_interval[0])\n right_y = int(iphone_dims[1] * (1.0 - right_ratio))\n line = [(pos[0], left_y), (iphone_dims[0], right_y)]\n DrawLine(line, line_color, 0.0)\n DrawLabel(datetime.fromtimestamp(timestamp).strftime(fmt),\n iphone_dims[0], right_y, text_color, font, 0.0)\n\n def _DrawHorizontalGuideLine(timestamp, fmt, transparency=0.0):\n \"\"\"Draws a guide line from current interval at 'timestamp' to the max\n interval.\n \"\"\"\n left_ratio = float(timestamp - interval[0]) / interval_size\n left_y = int(iphone_dims[1] * (1.0 - left_ratio))\n right_ratio = float(timestamp - max_interval[0]) / (max_interval[1] - max_interval[0])\n right_y = int(iphone_dims[1] * (1.0 - right_ratio))\n line = [(iphone_dims[0] - 60, right_y), (iphone_dims[0], right_y)]\n DrawLine(line, line_color, 0.0)\n DrawLabel(datetime.fromtimestamp(timestamp).strftime(fmt),\n iphone_dims[0]-60, right_y, text_color, font, 0.0)\n\n # Draw interval guide lines.\n [_DrawHorizontalGuideLine(x, '%b %d, %Y') for x in interval]\n _DrawHorizontalGuideLine(cur_time, '%b %d, %Y')\n\n interval = max_interval\n interval_size = max_interval[1] - max_interval[0]\n def _DrawIntervalTick(timestamp, fmt, transparency=0.0):\n \"\"\"Draws a guide label with specified 'timestamp' and 'fmt'.\"\"\"\n label = datetime.fromtimestamp(timestamp).strftime(fmt)\n ratio = float(timestamp - interval[0]) / interval_size\n x = iphone_dims[0]#max(min_tick_x_offset, pos[0])\n y = int(iphone_dims[1] * (1.0 - ratio))\n DrawLabel(label, x, y, text_color, font, transparency)\n\n # Draw ticks for days, months, & years.\n start = datetime.fromtimestamp(interval[0])\n end = datetime.fromtimestamp(interval[1])\n\n fade_interval = [60, 4]\n if interval_size < DAY * fade_interval[0]:\n transparency = max(0.0, (float(interval_size - DAY * fade_interval[1]) / DAY) / (fade_interval[0] - fade_interval[1]))\n cur = start.replace(hour=0, minute=0, second=0, microsecond=0)\n while cur < end:\n _DrawIntervalTick(time.mktime(cur.timetuple()), '%b %d, %Y', transparency)\n cur = cur + timedelta(days=1)\n\n fade_interval = [36, 12]\n if interval_size < MONTH * fade_interval[0]:\n transparency = max(0.0, (float(interval_size - MONTH * fade_interval[1]) / MONTH) / (fade_interval[0] - fade_interval[1]))\n cur = start.replace(day=1, hour=0, minute=0, second=0, microsecond=0)\n while cur < end:\n _DrawIntervalTick(time.mktime(cur.timetuple()), '%b %Y', transparency)\n cur = GetNextMonth(cur)\n\n # Draw years if there are possibly more than two displayed.\n if interval_size >= MONTH * 12:\n cur = start.replace(month=1, day=1, hour=0, minute=0, second=0, microsecond=0)\n while cur < end:\n _DrawIntervalTick(time.mktime(cur.timetuple()), '%Y')\n cur = cur.replace(year=cur.year + 1, month=1, day=1, hour=0, minute=0, second=0, microsecond=0)\n\n #DrawLabel(datetime.fromtimestamp(cur_time).strftime('%b %d, %Y'),\n # pos[0], pos[1], cur_time_color, font, 0.0)\n # Draw max interval labels.\n #DrawLabel(datetime.fromtimestamp(max_interval[1]).strftime('%b %d, %Y'),\n # iphone_dims[0], 0, text_color, font, 0.0)\n #DrawLabel(datetime.fromtimestamp(max_interval[0]).strftime('%b %d, %Y'),\n # iphone_dims[0], iphone_dims[1], text_color, font, 0.0)", "metadata": "root.DrawGuides", "header": "['module', '___EOS___']", "index": 278 }, { "content": "def RenderEvents(vf_time, places):\n \"\"\"Renders events based on the current time and interval available\n via vf_time.\n \"\"\"\n # Get circle and draw it.\n c, r, theta = GetCircle(vf_time.GetPos())\n\n def _GetArcCoords(radians):\n \"\"\"Returns the coordinates on the arc for the specified angle.\"\"\"\n return [c[0] + r*math.cos(radians), c[1] + r*math.sin(radians)]\n\n def _GetTimestamp(radians):\n \"\"\"Gets timestamp implied by moving to 'radians' degrees on the arc.\"\"\"\n return vf_time.ComputeTimeAtPos(_GetArcCoords(radians))\n\n def _ApproximateAngle(timestamp, x, x1):\n \"\"\"Determines the position along the arc of the specified timestamp\n via numeric approximation (Secant Method).\n \"\"\"\n def f(x):\n return _GetTimestamp(x) - timestamp\n error = 1 # get within 1 pixel\n x2 = 0\n for attempt in xrange(20):\n d = f(x1) - f(x)\n if d < error:\n return x1\n x2 = x1 - f(x1) * (x1 - x) / d\n x = x1\n x1 = x2\n dx = x1 - x\n assert False, 'could not converge on position'\n\n def _ComputeDecay(distance, half_distance):\n return math.exp(-math.log(2.0) * distance / half_distance)\n\n interval = vf_time.GetInterval()\n combined_places = CombinePlaces(places, float(interval[1] - interval[0]) / 24)\n start_angle = math.pi - theta / 2\n end_angle = math.pi + theta / 2\n text_height = 16.0\n half_distance = 12.0\n\n places = []\n for p in combined_places:\n place_angle = _ApproximateAngle(p['timestamp'], start_angle, end_angle)\n if place_angle > start_angle and place_angle < end_angle:\n p['x'], p['y'] = _GetArcCoords(place_angle)\n places.append(p)\n\n # For each place, compute the rank in the 'neighborhood'.\n for p in places:\n y = p['y']\n sub_places = [sp for sp in places if sp['y'] > (y - text_height) and sp['y'] < (y + text_height)]\n max_count = max([sp['total_count'] for sp in sub_places])\n total_weight = 0\n for sp in sub_places:\n total_weight += (float(sp['total_count']) / max_count) * _ComputeDecay(abs(sp['y'] - y), half_distance)\n p['weight'] = (float(p['total_count']) / max_count) / total_weight\n\n if places:\n min_weight = min(p['weight'] for p in places)\n max_weight = max(p['weight'] for p in places)\n sorted_places = sorted(places, key=itemgetter('weight'))\n for p in sorted_places:\n if min_weight == max_weight:\n opacity = 1.0\n else:\n opacity = (p['weight'] - min_weight) / (max_weight - min_weight)\n DrawLabel('%s' % (p['locality']), p['x'], p['y'], place_color,\n font, 1.0 - opacity, left_justify=True)", "metadata": "root.RenderEvents", "header": "['module', '___EOS___']", "index": 432 }, { "content": "def main():\n vp_data = []\n with open(os.path.join(os.path.dirname(__file__), 'viewpoint_data.txt'), 'r') as f:\n vp_data = json.load(f)\n vp_data = [vp for vp in vp_data if 'placemark' in vp]\n for index in xrange(len(vp_data)):\n vp = vp_data[index]\n vp['index'] = index\n vp['timestamp'] = index * event_height\n vp['datetime'] = datetime.fromtimestamp(vp['timestamp'])\n\n max_date = vp_data[0]['datetime']\n min_date = vp_data[-1]['datetime']\n vf_time = VFTime(vp_data[0]['timestamp'], vp_data[-1]['timestamp'])\n\n # Rates encompass: X years, 12 months, 28-31 days, 24 hours.\n levels = ['hours', 'days', 'months', 'years']\n level = levels[-1]\n display_places = False\n\n while True:\n ClearSurface()\n ProcessMotion(vf_time)\n if not vf_time.IsActive():\n DrawTargetBoxes()\n else:\n label = vf_time.GetDatetime().strftime('%b %d %Y')\n DrawGuides(vf_time)\n\n # Get list of viewpoints with place information between min-max dates.\n interval = vf_time.GetInterval()\n start = interval[0] - (interval[1] - interval[0]) / 2\n end = interval[1] + (interval[1] - interval[0]) / 2\n places = [vp for vp in vp_data if vp['timestamp'] > start and vp['timestamp'] < end]\n if vf_time.GetPos()[0] < 500:\n display_places = True\n if display_places:\n RenderEvents(vf_time, vp_data)\n\n pygame.display.flip()", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 536 } ]
[ { "span": "c ", "start_line": 154, "start_column": 4, "end_line": 154, "end_column": 5 }, { "span": "max_interval_size ", "start_line": 288, "start_column": 2, "end_line": 288, "end_column": 19 }, { "span": "_DrawGuideLine(", "start_line": 290, "start_column": 6, "end_line": 290, "end_column": 20 }, { "span": "left_y ", "start_line": 308, "start_column": 4, "end_line": 308, "end_column": 10 }, { "span": "dx ", "start_line": 462, "start_column": 6, "end_line": 462, "end_column": 8 }, { "span": "max_date ", "start_line": 547, "start_column": 2, "end_line": 547, "end_column": 10 }, { "span": "min_date ", "start_line": 548, "start_column": 2, "end_line": 548, "end_column": 10 }, { "span": "level ", "start_line": 553, "start_column": 2, "end_line": 553, "end_column": 7 }, { "span": "label ", "start_line": 562, "start_column": 6, "end_line": 562, "end_column": 11 }, { "span": "places ", "start_line": 569, "start_column": 6, "end_line": 569, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "VF", "Time_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Integrate", "Time_", "(_", "self_", ",_", "new", "\\u", "pos_", ",_", "log_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Integrate", "s", " ", "time", " ", "by", " ", "movement", " ", "along", " ", "the", " ", "linear", " ", "path", " ", "defin", "ed", " ", "by", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "vector", " ", "bet", "ween", " ", "self", ".\\u", "last", "\\u", "pos", " ", "and", " ", "new", "\\u", "pos", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "'", "m", "':", " ", "slope", " ", "of", " ", "line", " ", "from", " ", "self", ".\\u", "last", "\\u", "pos", " ", "to", " ", "new", "\\u", "pos", ".", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "'", "a", "':", " ", "max", " ", "rate", " ", "of", " ", "change", " ", "(", "self", ".\\u", "roc", "\\u", "max", ")", " ", "is", " ", "(", "max", " ", "-", " ", "min", " ", "second", "s", ")", " ", "/", " ", "screen", " ", "height", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "'", "b", "':", " ", "rate", " ", "of", " ", "change", " ", "slope", " ", "(", "self", ".\\u", "roc", "\\u", "slope", ")", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "'", "c", "':", " ", "last", " ", "Y", " ", "position", " ", "(", "self", ".\\u", "last", "\\u", "pos", "[", "1", "])", "\\", "10", ";", " ", " ", " ", " ", "-", " ", "'", "d", "':", " ", "expon", "ent", " ", "in", " ", "an", " ", "inv", "erse", " ", "exponential", " ", "curve", " ", "from", " ", "max", " ", "roc", " ", "to", " ", "min", " ", "roc", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x", "\\u", "delta_", "=_", "float_", "(_", "new", "\\u", "pos_", "[_", "0_", "]_", "-_", "self_", "._", "\\u", "last", "\\u", "pos_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y", "\\u", "delta_", "=_", "(_", "new", "\\u", "pos_", "[_", "1_", "]_", "-_", "self_", "._", "\\u", "last", "\\u", "pos_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "y", "\\u", "delta_", "==_", "0.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0.0_", "#", " ", "no", " ", "integrati", "on", " ", "necessar", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "m_", "=_", "x", "\\u", "delta_", "/_", "y", "\\u", "delta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", "=_", "self_", "._", "\\u", "roc", "\\u", "max_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "b_", "=_", "self_", "._", "\\u", "roc", "\\u", "slope_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "float_", "(_", "self_", "._", "\\u", "last", "\\u", "pos_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "Compute", "Integral_", "(_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0.5_", "*_", "y_", "*_", "(_", "2_", "*_", "a_", "+_", "b_", "*_", "(_", "2_", "*_", "self_", "._", "\\u", "last", "\\u", "pos_", "[_", "0_", "]_", "+_", "m_", "*_", "(_", "y_", "-_", "2_", "*_", "self_", "._", "\\u", "last", "\\u", "pos_", "[_", "1_", "]_", ")_", ")_", ")_", "\\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 ", " _", "max", "\\u", "diff_", "=_", "(_", "new", "\\u", "pos_", "[_", "1_", "]_", "-_", "self_", "._", "\\u", "last", "\\u", "pos_", "[_", "1_", "]_", ")_", "*_", "(_", "self_", "._", "\\u", "roc", "\\u", "max_", "+_", "self_", "._", "\\u", "roc", "\\u", "slope_", "*_", "min_", "(_", "new", "\\u", "pos_", "[_", "0_", "]_", ",_", "self_", "._", "\\u", "last", "\\u", "pos_", "[_", "0_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "max", " ", "interval", ":", " ", "%", ".2", "f", "'_", "%_", "(_", "self_", "._", "\\u", "max", "\\u", "time_", "-_", "self_", "._", "\\u", "min", "\\u", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "x", " ", "delta", ":", " ", "%", ".2", "f", ",", " ", "y", " ", "delta", ":", " ", "%", ".2", "f", ",", " ", "slope", ":", " ", "%", ".2", "f", "'_", "%_", "(_", "x", "\\u", "delta_", ",_", "y", "\\u", "delta_", ",_", "1_", "/_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "max", " ", "difference", " ", "allow", "ed", ":", " ", "%", ".2", "f", "'_", "%_", "max", "\\u", "diff_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "integral", " ", "at", " ", "new", " ", "pos", ":", " ", "%", ".2", "f", "'_", "%_", "\\u", "Compute", "Integral_", "(_", "new", "\\u", "pos_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "integral", " ", "at", " ", "old", " ", "pos", ":", " ", "%", ".2", "f", "'_", "%_", "\\u", "Compute", "Integral_", "(_", "self_", "._", "\\u", "last", "\\u", "pos_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "'", "integrated", " ", "difference", ":", " ", "%", ".2", "f", "'_", "%_", "(_", "\\u", "Compute", "Integral_", "(_", "new", "\\u", "pos_", "[_", "1_", "]_", ")_", "-_", "\\u", "Compute", "Integral_", "(_", "self_", "._", "\\u", "last", "\\u", "pos_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\\u", "Compute", "Integral_", "(_", "new", "\\u", "pos_", "[_", "1_", "]_", ")_", "-_", "\\u", "Compute", "Integral_", "(_", "self_", "._", "\\u", "last", "\\u", "pos_", "[_", "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_", "def_", "Draw", "Guide", "s_", "(_", "vf", "\\u", "time_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Draw", "s", " ", "guide", "s", " ", "showin", "g", " ", "the", " ", "currentl", "y", " ", "displaye", "d", " ", "interval", " ", "at", " ", "scale", " ", "on", "\\", "10", ";", " ", " ", "the", " ", "right", " ", "side", " ", "of", " ", "the", " ", "screen", ".", " ", "Al", "so", " ", "draw", " ", "a", " ", "line", " ", "back", "ward", "s", " ", "from", " ", "the", "\\", "10", ";", " ", " ", "current", " ", "time", " ", "to", " ", "the", " ", "correspond", "ing", " ", "time", " ", "on", " ", "the", " ", "right", " ", "side", " ", "interval", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pos_", "=_", "vf", "\\u", "time_", "._", "Get", "Pos_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur", "\\u", "time_", "=_", "vf", "\\u", "time_", "._", "Get", "Time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "interval_", "=_", "vf", "\\u", "time_", "._", "Get", "Interval_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "interval", "\\u", "size_", "=_", "interval_", "[_", "1_", "]_", "-_", "interval_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "interval_", "=_", "vf", "\\u", "time_", "._", "Get", "Max", "Interval_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "interval", "\\u", "size_", "=_", "max", "\\u", "interval_", "[_", "1_", "]_", "-_", "max", "\\u", "interval_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "Draw", "Guide", "Line_", "(_", "timestamp_", ",_", "fmt_", ",_", "transparency", "_", "=_", "0.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Draw", "s", " ", "a", " ", "guide", " ", "line", " ", "from", " ", "current", " ", "interval", " ", "at", " ", "'", "timestamp", "'", " ", "to", " ", "the", " ", "max", "\\", "10", ";", " ", " ", " ", " ", "interval", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left", "\\u", "ratio_", "=_", "float_", "(_", "timestamp_", "-_", "interval_", "[_", "0_", "]_", ")_", "/_", "interval", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left", "\\u", "y_", "=_", "int_", "(_", "iph", "one", "\\u", "dims_", "[_", "1_", "]_", "*_", "(_", "1.0_", "-_", "left", "\\u", "ratio_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "right", "\\u", "ratio_", "=_", "float_", "(_", "timestamp_", "-_", "max", "\\u", "interval_", "[_", "0_", "]_", ")_", "/_", "(_", "max", "\\u", "interval_", "[_", "1_", "]_", "-_", "max", "\\u", "interval_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "right", "\\u", "y_", "=_", "int_", "(_", "iph", "one", "\\u", "dims_", "[_", "1_", "]_", "*_", "(_", "1.0_", "-_", "right", "\\u", "ratio_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "[_", "(_", "pos_", "[_", "0_", "]_", ",_", "left", "\\u", "y_", ")_", ",_", "(_", "iph", "one", "\\u", "dims_", "[_", "0_", "]_", ",_", "right", "\\u", "y_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Draw", "Line_", "(_", "line_", ",_", "line", "\\u", "color_", ",_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Draw", "Label_", "(_", "datetime_", "._", "fromtimestamp_", "(_", "timestamp_", ")_", "._", "strftime_", "(_", "fmt_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "iph", "one", "\\u", "dims_", "[_", "0_", "]_", ",_", "right", "\\u", "y_", ",_", "text", "\\u", "color_", ",_", "font_", ",_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Draw", "Horiz", "onta", "l", "Guide", "Line_", "(_", "timestamp_", ",_", "fmt_", ",_", "transparency", "_", "=_", "0.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Draw", "s", " ", "a", " ", "guide", " ", "line", " ", "from", " ", "current", " ", "interval", " ", "at", " ", "'", "timestamp", "'", " ", "to", " ", "the", " ", "max", "\\", "10", ";", " ", " ", " ", " ", "interval", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left", "\\u", "ratio_", "=_", "float_", "(_", "timestamp_", "-_", "interval_", "[_", "0_", "]_", ")_", "/_", "interval", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left", "\\u", "y_", "=_", "int_", "(_", "iph", "one", "\\u", "dims_", "[_", "1_", "]_", "*_", "(_", "1.0_", "-_", "left", "\\u", "ratio_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "right", "\\u", "ratio_", "=_", "float_", "(_", "timestamp_", "-_", "max", "\\u", "interval_", "[_", "0_", "]_", ")_", "/_", "(_", "max", "\\u", "interval_", "[_", "1_", "]_", "-_", "max", "\\u", "interval_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "right", "\\u", "y_", "=_", "int_", "(_", "iph", "one", "\\u", "dims_", "[_", "1_", "]_", "*_", "(_", "1.0_", "-_", "right", "\\u", "ratio_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "line_", "=_", "[_", "(_", "iph", "one", "\\u", "dims_", "[_", "0_", "]_", "-_", "60_", ",_", "right", "\\u", "y_", ")_", ",_", "(_", "iph", "one", "\\u", "dims_", "[_", "0_", "]_", ",_", "right", "\\u", "y_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Draw", "Line_", "(_", "line_", ",_", "line", "\\u", "color_", ",_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Draw", "Label_", "(_", "datetime_", "._", "fromtimestamp_", "(_", "timestamp_", ")_", "._", "strftime_", "(_", "fmt_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "iph", "one", "\\u", "dims_", "[_", "0_", "]_", "-_", "60_", ",_", "right", "\\u", "y_", ",_", "text", "\\u", "color_", ",_", "font_", ",_", "0.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Draw", " ", "interval", " ", "guide", " ", "lines", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[_", "\\u", "Draw", "Horiz", "onta", "l", "Guide", "Line_", "(_", "x_", ",_", "'%", "b", " ", "%", "d", ",", " ", "%", "Y", "'_", ")_", "for_", "x_", "in_", "interval_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "Draw", "Horiz", "onta", "l", "Guide", "Line_", "(_", "cur", "\\u", "time_", ",_", "'%", "b", " ", "%", "d", ",", " ", "%", "Y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "interval_", "=_", "max", "\\u", "interval_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "interval", "\\u", "size_", "=_", "max", "\\u", "interval_", "[_", "1_", "]_", "-_", "max", "\\u", "interval_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u", "Draw", "Interv", "al", "Tic", "k_", "(_", "timestamp_", ",_", "fmt_", ",_", "transparency", "_", "=_", "0.0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Draw", "s", " ", "a", " ", "guide", " ", "label", " ", "with", " ", "specified", " ", "'", "timestamp", "'", " ", "and", " ", "'", "fmt", "'.", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "label_", "=_", "datetime_", "._", "fromtimestamp_", "(_", "timestamp_", ")_", "._", "strftime_", "(_", "fmt_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ratio_", "=_", "float_", "(_", "timestamp_", "-_", "interval_", "[_", "0_", "]_", ")_", "/_", "interval", "\\u", "size_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "iph", "one", "\\u", "dims_", "[_", "0_", "]_", "#", "max", "(", "min", "\\u", "tick", "\\u", "x", "\\u", "offset", ",", " ", "pos", "[", "0", "])", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "int_", "(_", "iph", "one", "\\u", "dims_", "[_", "1_", "]_", "*_", "(_", "1.0_", "-_", "ratio_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Draw", "Label_", "(_", "label_", ",_", "x_", ",_", "y_", ",_", "text", "\\u", "color_", ",_", "font_", ",_", "transparency", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Draw", " ", "tick", "s", " ", "for", " ", "day", "s", ",", " ", "month", "s", ",", " ", "&", " ", "year", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "start_", "=_", "datetime_", "._", "fromtimestamp_", "(_", "interval_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end_", "=_", "datetime_", "._", "fromtimestamp_", "(_", "interval_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fade", "\\u", "interval_", "=_", "[_", "60_", ",_", "4_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "interval", "\\u", "size_", "<_", "DAY_", "*_", "fade", "\\u", "interval_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transparency", "_", "=_", "max_", "(_", "0.0_", ",_", "(_", "float_", "(_", "interval", "\\u", "size_", "-_", "DAY_", "*_", "fade", "\\u", "interval_", "[_", "1_", "]_", ")_", "/_", "DAY_", ")_", "/_", "(_", "fade", "\\u", "interval_", "[_", "0_", "]_", "-_", "fade", "\\u", "interval_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "start_", "._", "replace_", "(_", "hour_", "=_", "0_", ",_", "minute_", "=_", "0_", ",_", "second_", "=_", "0_", ",_", "microsecond_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "cur_", "<_", "end_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "Draw", "Interv", "al", "Tic", "k_", "(_", "time_", "._", "mktime_", "(_", "cur_", "._", "timetuple_", "(_", ")_", ")_", ",_", "'%", "b", " ", "%", "d", ",", " ", "%", "Y", "'_", ",_", "transparency", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "cur_", "+_", "timedelta_", "(_", "days_", "=_", "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_", "fade", "\\u", "interval_", "=_", "[_", "36_", ",_", "12_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "interval", "\\u", "size_", "<_", "MONTH", "_", "*_", "fade", "\\u", "interval_", "[_", "0_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "transparency", "_", "=_", "max_", "(_", "0.0_", ",_", "(_", "float_", "(_", "interval", "\\u", "size_", "-_", "MONTH", "_", "*_", "fade", "\\u", "interval_", "[_", "1_", "]_", ")_", "/_", "MONTH", "_", ")_", "/_", "(_", "fade", "\\u", "interval_", "[_", "0_", "]_", "-_", "fade", "\\u", "interval_", "[_", "1_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "start_", "._", "replace_", "(_", "day_", "=_", "1_", ",_", "hour_", "=_", "0_", ",_", "minute_", "=_", "0_", ",_", "second_", "=_", "0_", ",_", "microsecond_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "cur_", "<_", "end_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "Draw", "Interv", "al", "Tic", "k_", "(_", "time_", "._", "mktime_", "(_", "cur_", "._", "timetuple_", "(_", ")_", ")_", ",_", "'%", "b", " ", "%", "Y", "'_", ",_", "transparency", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "Get", "Ne", "xt", "Month_", "(_", "cur_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Draw", " ", "year", "s", " ", "if", " ", "there", " ", "are", " ", "possib", "ly", " ", "more", " ", "than", " ", "two", " ", "displaye", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "interval", "\\u", "size_", ">=_", "MONTH", "_", "*_", "12_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "cur_", "=_", "start_", "._", "replace_", "(_", "month_", "=_", "1_", ",_", "day_", "=_", "1_", ",_", "hour_", "=_", "0_", ",_", "minute_", "=_", "0_", ",_", "second_", "=_", "0_", ",_", "microsecond_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "cur_", "<_", "end_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\\u", "Draw", "Interv", "al", "Tic", "k_", "(_", "time_", "._", "mktime_", "(_", "cur_", "._", "timetuple_", "(_", ")_", ")_", ",_", "'%", "Y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cur_", "=_", "cur_", "._", "replace_", "(_", "year_", "=_", "cur_", "._", "year_", "+_", "1_", ",_", "month_", "=_", "1_", ",_", "day_", "=_", "1_", ",_", "hour_", "=_", "0_", ",_", "minute_", "=_", "0_", ",_", "second_", "=_", "0_", ",_", "microsecond_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Draw", "Label", "(", "datetime", ".", "from", "timestamp", "(", "cur", "\\u", "time", ").", "strf", "time", "('", "%", "b", " ", "%", "d", ",", " ", "%", "Y", "')", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "pos", "[", "0", "],", " ", "pos", "[", "1", "],", " ", "cur", "\\u", "time", "\\u", "color", ",", " ", "font", ",", " ", "0.", "0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Draw", " ", "max", " ", "interval", " ", "labels", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "Draw", "Label", "(", "datetime", ".", "from", "timestamp", "(", "max", "\\u", "interval", "[", "1", "])", ".", "strf", "time", "('", "%", "b", " ", "%", "d", ",", " ", "%", "Y", "')", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "iph", "one", "\\u", "dims", "[", "0", "],", " ", "0", ",", " ", "text", "\\u", "color", ",", " ", "font", ",", " ", "0.", "0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Draw", "Label", "(", "datetime", ".", "from", "timestamp", "(", "max", "\\u", "interval", "[", "0", "])", ".", "strf", "time", "('", "%", "b", " ", "%", "d", ",", " ", "%", "Y", "')", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", "iph", "one", "\\u", "dims", "[", "0", "],", " ", "iph", "one", "\\u", "dims", "[", "1", "],", " ", "text", "\\u", "color", ",", " ", "font", ",", " ", "0.", "0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "Render", "Events_", "(_", "vf", "\\u", "time_", ",_", "places_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Render", "s", " ", "events", " ", "based", " ", "on", " ", "the", " ", "current", " ", "time", " ", "and", " ", "interval", " ", "avail", "able", "\\", "10", ";", " ", " ", "via", " ", "vf", "\\u", "time", ".", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Get", " ", "circle", " ", "and", " ", "draw", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "c_", ",_", "r_", ",_", "theta_", "=_", "Get", "Circle_", "(_", "vf", "\\u", "time_", "._", "Get", "Pos_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u", "Get", "Arc", "Coords_", "(_", "radians_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Return", "s", " ", "the", " ", "coordinate", "s", " ", "on", " ", "the", " ", "arc", " ", "for", " ", "the", " ", "specified", " ", "angle", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "[_", "c_", "[_", "0_", "]_", "+_", "r_", "*_", "math_", "._", "cos_", "(_", "radians_", ")_", ",_", "c_", "[_", "1_", "]_", "+_", "r_", "*_", "math_", "._", "sin_", "(_", "radians_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Get", "Timestamp_", "(_", "radians_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Get", "s", " ", "timestamp", " ", "impli", "ed", " ", "by", " ", "movin", "g", " ", "to", " ", "'", "radian", "s", "'", " ", "degr", "ees", " ", "on", " ", "the", " ", "arc", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "vf", "\\u", "time_", "._", "Compute", "Time", "At", "Pos_", "(_", "\\u", "Get", "Arc", "Coords_", "(_", "radians_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Approx", "imat", "e", "Angle_", "(_", "timestamp_", ",_", "x_", ",_", "x1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Det", "erm", "ine", "s", " ", "the", " ", "position", " ", "along", " ", "the", " ", "arc", " ", "of", " ", "the", " ", "specified", " ", "timestamp", "\\", "10", ";", " ", " ", " ", " ", "via", " ", "numeri", "c", " ", "approx", "imat", "ion", " ", "(", "Sec", "ant", " ", "Meth", "od", ").", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "f_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u", "Get", "Timestamp_", "(_", "x_", ")_", "-_", "timestamp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "error_", "=_", "1_", "#", " ", "get", " ", "within", " ", "1", " ", "pixel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x2_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "attempt_", "in_", "xrange_", "(_", "20_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "f_", "(_", "x1_", ")_", "-_", "f_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "d_", "<_", "error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "x2_", "=_", "x1_", "-_", "f_", "(_", "x1_", ")_", "*_", "(_", "x1_", "-_", "x_", ")_", "/_", "d_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "x1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x1_", "=_", "x2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "dx_", "=_", "x1_", "-_", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "False_", ",_", "'", "coul", "d", " ", "not", " ", "converg", "e", " ", "on", " ", "position", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "Compute", "Decay", "_", "(_", "distance_", ",_", "half", "\\u", "distance_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "math_", "._", "exp_", "(_", "-_", "math_", "._", "log_", "(_", "2.0_", ")_", "*_", "distance_", "/_", "half", "\\u", "distance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "interval_", "=_", "vf", "\\u", "time_", "._", "Get", "Interval_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "combin", "ed", "\\u", "places_", "=_", "Combine", "Places", "_", "(_", "places_", ",_", "float_", "(_", "interval_", "[_", "1_", "]_", "-_", "interval_", "[_", "0_", "]_", ")_", "/_", "24_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start", "\\u", "angle_", "=_", "math_", "._", "pi_", "-_", "theta_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end", "\\u", "angle_", "=_", "math_", "._", "pi_", "+_", "theta_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "text", "\\u", "height_", "=_", "16.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "half", "\\u", "distance_", "=_", "12.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "places_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "combin", "ed", "\\u", "places_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "place", "\\u", "angle_", "=_", "\\u", "Approx", "imat", "e", "Angle_", "(_", "p_", "[_", "'", "timestamp", "'_", "]_", ",_", "start", "\\u", "angle_", ",_", "end", "\\u", "angle_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "place", "\\u", "angle_", ">_", "start", "\\u", "angle_", "and_", "place", "\\u", "angle_", "<_", "end", "\\u", "angle_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "p_", "[_", "'", "x", "'_", "]_", ",_", "p_", "[_", "'", "y", "'_", "]_", "=_", "\\u", "Get", "Arc", "Coords_", "(_", "place", "\\u", "angle_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "places_", "._", "append_", "(_", "p_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "each", " ", "place", ",", " ", "compute", " ", "the", " ", "rank", " ", "in", " ", "the", " ", "'", "neighborhood", "'.", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "p_", "in_", "places_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "y_", "=_", "p_", "[_", "'", "y", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sub\\u", "places_", "=_", "[_", "sp_", "for_", "sp_", "in_", "places_", "if_", "sp_", "[_", "'", "y", "'_", "]_", ">_", "(_", "y_", "-_", "text", "\\u", "height_", ")_", "and_", "sp_", "[_", "'", "y", "'_", "]_", "<_", "(_", "y_", "+_", "text", "\\u", "height_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "count_", "=_", "max_", "(_", "[_", "sp_", "[_", "'", "total", "\\u", "count", "'_", "]_", "for_", "sp_", "in_", "sub\\u", "places_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total", "\\u", "weight_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "sp_", "in_", "sub\\u", "places_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "total", "\\u", "weight_", "+=_", "(_", "float_", "(_", "sp_", "[_", "'", "total", "\\u", "count", "'_", "]_", ")_", "/_", "max", "\\u", "count_", ")_", "*_", "\\u", "Compute", "Decay", "_", "(_", "abs_", "(_", "sp_", "[_", "'", "y", "'_", "]_", "-_", "y_", ")_", ",_", "half", "\\u", "distance_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "p_", "[_", "'", "weight", "'_", "]_", "=_", "(_", "float_", "(_", "p_", "[_", "'", "total", "\\u", "count", "'_", "]_", ")_", "/_", "max", "\\u", "count_", ")_", "/_", "total", "\\u", "weight_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "places_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "min", "\\u", "weight_", "=_", "min_", "(_", "p_", "[_", "'", "weight", "'_", "]_", "for_", "p_", "in_", "places_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "weight_", "=_", "max_", "(_", "p_", "[_", "'", "weight", "'_", "]_", "for_", "p_", "in_", "places_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sorte", "d\\u", "places_", "=_", "sorted_", "(_", "places_", ",_", "key_", "=_", "itemgetter_", "(_", "'", "weight", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "p_", "in_", "sorte", "d\\u", "places_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "min", "\\u", "weight_", "==_", "max", "\\u", "weight_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "opacity_", "=_", "1.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 ", " _", "opacity_", "=_", "(_", "p_", "[_", "'", "weight", "'_", "]_", "-_", "min", "\\u", "weight_", ")_", "/_", "(_", "max", "\\u", "weight_", "-_", "min", "\\u", "weight_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "Draw", "Label_", "(_", "'%", "s", "'_", "%_", "(_", "p_", "[_", "'", "locality", "'_", "]_", ")_", ",_", "p_", "[_", "'", "x", "'_", "]_", ",_", "p_", "[_", "'", "y", "'_", "]_", ",_", "place", "\\u", "color_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "font_", ",_", "1.0_", "-_", "opacity_", ",_", "left", "\\u", "justify_", "=_", "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_", "def_", "main_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vp", "\\u", "data_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "with_", "open_", "(_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", ",_", "'", "view", "point", "\\u", "data", ".", "txt", "'_", ")_", ",_", "'", "r", "'_", ")_", "as_", "f_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vp", "\\u", "data_", "=_", "json_", "._", "load_", "(_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vp", "\\u", "data_", "=_", "[_", "vp_", "for_", "vp_", "in_", "vp", "\\u", "data_", "if_", "'", "placem", "ark", "'_", "in_", "vp_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "index_", "in_", "xrange_", "(_", "len_", "(_", "vp", "\\u", "data_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "vp_", "=_", "vp", "\\u", "data_", "[_", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vp_", "[_", "'", "index", "'_", "]_", "=_", "index_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vp_", "[_", "'", "timestamp", "'_", "]_", "=_", "index_", "*_", "event", "\\u", "height_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vp_", "[_", "'", "datetime", "'_", "]_", "=_", "datetime_", "._", "fromtimestamp_", "(_", "vp_", "[_", "'", "timestamp", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "max", "\\u", "date_", "=_", "vp", "\\u", "data_", "[_", "0_", "]_", "[_", "'", "datetime", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "min", "\\u", "date_", "=_", "vp", "\\u", "data_", "[_", "-_", "1_", "]_", "[_", "'", "datetime", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "vf", "\\u", "time_", "=_", "VF", "Time_", "(_", "vp", "\\u", "data_", "[_", "0_", "]_", "[_", "'", "timestamp", "'_", "]_", ",_", "vp", "\\u", "data_", "[_", "-_", "1_", "]_", "[_", "'", "timestamp", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Rates", " ", "enco", "mpa", "ss", ":", " ", "X", " ", "year", "s", ",", " ", "1", "2", " ", "month", "s", ",", " ", "2", "8", "-", "3", "1", " ", "day", "s", ",", " ", "24", " ", "hour", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "levels_", "=_", "[_", "'", "hour", "s", "'_", ",_", "'", "day", "s", "'_", ",_", "'", "month", "s", "'_", ",_", "'", "year", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "level_", "=_", "levels_", "[_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "display", "\\u", "places_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "while_", "True_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Clear", "Surface_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Process", "Motion", "_", "(_", "vf", "\\u", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "vf", "\\u", "time_", "._", "Is", "Active_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Draw", "Target", "Boxes", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "label_", "=_", "vf", "\\u", "time_", "._", "Get", "Datetime_", "(_", ")_", "._", "strftime_", "(_", "'%", "b", " ", "%", "d", " ", "%", "Y", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "Draw", "Guide", "s_", "(_", "vf", "\\u", "time_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "list", " ", "of", " ", "view", "points", " ", "with", " ", "place", " ", "informati", "on", " ", "bet", "ween", " ", "min", "-", "max", " ", "dates", "._", "\\u\\u\\uNL\\u\\u\\u_", "interval_", "=_", "vf", "\\u", "time_", "._", "Get", "Interval_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "interval_", "[_", "0_", "]_", "-_", "(_", "interval_", "[_", "1_", "]_", "-_", "interval_", "[_", "0_", "]_", ")_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end_", "=_", "interval_", "[_", "1_", "]_", "+_", "(_", "interval_", "[_", "1_", "]_", "-_", "interval_", "[_", "0_", "]_", ")_", "/_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "places_", "=_", "[_", "vp_", "for_", "vp_", "in_", "vp", "\\u", "data_", "if_", "vp_", "[_", "'", "timestamp", "'_", "]_", ">_", "start_", "and_", "vp_", "[_", "'", "timestamp", "'_", "]_", "<_", "end_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "vf", "\\u", "time_", "._", "Get", "Pos_", "(_", ")_", "[_", "0_", "]_", "<_", "500_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "display", "\\u", "places_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "display", "\\u", "places_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Render", "Events_", "(_", "vf", "\\u", "time_", ",_", "vp", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pygame_", "._", "display_", "._", "flip_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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 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, 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 ]
Unused import
zen4ever/django-authorizenet/authorizenet/migrations/0002_auto__add_cimresponse.py
[ { "content": "# 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 'authorizenet.cimresponse': {\n 'Meta': {'object_name': 'CIMResponse'},\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'result': ('django.db.models.fields.CharField', [], {'max_length': '8'}),\n 'result_code': ('django.db.models.fields.CharField', [], {'max_length': '8'}),\n 'result_text': ('django.db.models.fields.CharField', [], {'max_length': '1023'}),\n 'transaction_response': ('django.db.models.fields.related.ForeignKey', [], {'to': \"orm['authorizenet.Response']\", 'null': 'True', 'blank': 'True'})\n },\n 'authorizenet.response': {\n 'MD5_Hash': ('django.db.models.fields.CharField', [], {'max_length': '255'}),\n 'Meta': {'object_name': 'Response'},\n 'address': ('django.db.models.fields.CharField', [], {'max_length': '60'}),\n 'amount': ('django.db.models.fields.CharField', [], {'max_length': '16'}),\n 'auth_code': ('django.db.models.fields.CharField', [], {'max_length': '10'}),\n 'avs_code': ('django.db.models.fields.CharField', [], {'max_length': '10'}),\n 'cavv_response': ('django.db.models.fields.CharField', [], {'max_length': '2', 'blank': 'True'}),\n 'city': ('django.db.models.fields.CharField', [], {'max_length': '40'}),\n 'company': ('django.db.models.fields.CharField', [], {'max_length': '50'}),\n 'country': ('django.db.models.fields.CharField', [], {'max_length': '60'}),\n 'cust_id': ('django.db.models.fields.CharField', [], {'max_length': '20'}),\n 'cvv2_resp_code': ('django.db.models.fields.CharField', [], {'max_length': '2', 'blank': 'True'}),\n 'description': ('django.db.models.fields.CharField', [], {'max_length': '255'}),\n 'duty': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}),\n 'email': ('django.db.models.fields.CharField', [], {'max_length': '255'}),\n 'fax': ('django.db.models.fields.CharField', [], {'max_length': '25'}),\n 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),\n 'freight': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}),\n 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'invoice_num': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),\n 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),\n 'method': ('django.db.models.fields.CharField', [], {'max_length': '10'}),\n 'phone': ('django.db.models.fields.CharField', [], {'max_length': '25'}),\n 'po_num': ('django.db.models.fields.CharField', [], {'max_length': '25', 'blank': 'True'}),\n 'response_code': ('django.db.models.fields.CharField', [], {'max_length': '2'}),\n 'response_reason_code': ('django.db.models.fields.CharField', [], {'max_length': '15'}),\n 'response_reason_text': ('django.db.models.fields.TextField', [], {}),\n 'response_subcode': ('django.db.models.fields.CharField', [], {'max_length': '10'}),\n 'ship_to_address': ('django.db.models.fields.CharField', [], {'max_length': '60', 'blank': 'True'}),\n 'ship_to_city': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}),\n 'ship_to_company': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),\n 'ship_to_country': ('django.db.models.fields.CharField', [], {'max_length': '60', 'blank': 'True'}),\n 'ship_to_first_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),\n 'ship_to_last_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),\n 'ship_to_state': ('django.db.models.fields.CharField', [], {'max_length': '40', 'blank': 'True'}),\n 'ship_to_zip': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),\n 'state': ('django.db.models.fields.CharField', [], {'max_length': '40'}),\n 'tax': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}),\n 'tax_exempt': ('django.db.models.fields.CharField', [], {'max_length': '16', 'blank': 'True'}),\n 'test_request': ('django.db.models.fields.CharField', [], {'default': \"'FALSE'\", 'max_length': '10', 'blank': 'True'}),\n 'trans_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),\n 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}),\n 'zip': ('django.db.models.fields.CharField', [], {'max_length': '20'})\n }\n }\n\n complete_apps = ['authorizenet']", "metadata": "root.Migration", "header": "['module', '___EOS___']", "index": 7 }, { "content": " def forwards(self, orm):\n\n # Adding model 'CIMResponse'\n db.create_table('authorizenet_cimresponse', (\n ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),\n ('result', self.gf('django.db.models.fields.CharField')(max_length=8)),\n ('result_code', self.gf('django.db.models.fields.CharField')(max_length=8)),\n ('result_text', self.gf('django.db.models.fields.CharField')(max_length=1023)),\n ('transaction_response', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['authorizenet.Response'], null=True, blank=True)),\n ))\n db.send_create_signal('authorizenet', ['CIMResponse'])", "metadata": "root.Migration.forwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 9 }, { "content": " def backwards(self, orm):\n\n # Deleting model 'CIMResponse'\n db.delete_table('authorizenet_cimresponse')", "metadata": "root.Migration.backwards", "header": "['class', 'Migration', '(', 'SchemaMigration', ')', ':', '___EOS___']", "index": 21 } ]
[ { "span": "import datetime", "start_line": 1, "start_column": 0, "end_line": 1, "end_column": 15 }, { "span": "from django.db import models", "start_line": 4, "start_column": 0, "end_line": 4, "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_", "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_", "'", "authoriz", "ene", "t", ".", "cim", "response", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "CI", "MR", "esp", "ons", "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_", "'", "result", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "8", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "result", "\\u", "code", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "8", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "result", "\\u", "text", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "1023", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "transaction", "\\u", "response", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ",_", "[_", "]_", ",_", "{_", "'", "to", "'_", ":_", "\"", "orm", "['", "authoriz", "ene", "t", ".", "Respons", "e", "']\"_", ",_", "'", "null", "'_", ":_", "'", "Tru", "e", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "authoriz", "ene", "t", ".", "response", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "MD", "5", "\\u", "Hash", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Meta", "'_", ":_", "{_", "'", "object\\u", "name", "'_", ":_", "'", "Respons", "e", "'_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "address", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "60", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "amo", "unt", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "16", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "auth", "\\u", "code", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "10", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "av", "s", "\\u", "code", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "10", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cav", "v", "\\u", "response", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "2", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "city", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "40", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "compan", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "countr", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "60", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cust", "\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "cv", "v2", "\\u", "resp", "\\u", "code", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "2", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "duty", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "16", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "email", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fax", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "25", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "first", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "fre", "ight", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "16", "'_", ",_", "'", "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_", "'", "invoic", "e\\u", "num", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "last", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "method", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "10", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "phone", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "25", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "po", "\\u", "num", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "25", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "response", "\\u", "code", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "2", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "response", "\\u", "reason", "\\u", "code", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "15", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "response", "\\u", "reason", "\\u", "text", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Text", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "response", "\\u", "subco", "de", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "10", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ship", "\\u", "to", "\\u", "address", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "60", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ship", "\\u", "to", "\\u", "city", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "40", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ship", "\\u", "to", "\\u", "compan", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ship", "\\u", "to", "\\u", "countr", "y", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "60", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ship", "\\u", "to", "\\u", "first", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ship", "\\u", "to", "\\u", "last", "\\u", "name", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "50", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ship", "\\u", "to", "\\u", "state", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "40", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "ship", "\\u", "to", "\\u", "zip", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "state", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "40", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tax", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "16", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "tax", "\\u", "exemp", "t", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "16", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "test\\u", "request", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "default", "'_", ":_", "\"'", "FAL", "SE", "'\"_", ",_", "'", "max", "\\u", "length", "'_", ":_", "'", "10", "'_", ",_", "'", "blank", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "trans", "\\u", "id", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "255", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", ",_", "'", "db", "\\u", "index", "'_", ":_", "'", "Tru", "e", "'_", "}_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "zip", "'_", ":_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ",_", "[_", "]_", ",_", "{_", "'", "max", "\\u", "length", "'_", ":_", "'", "20", "'_", "}_", ")_", "\\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_", "=_", "[_", "'", "authoriz", "ene", "t", "'_", "]_", "[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", " ", "'", "CI", "MR", "esp", "ons", "e", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "db_", "._", "create", "\\u", "table_", "(_", "'", "authoriz", "ene", "t", "\\u", "cim", "response", "'_", ",_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "id", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Auto", "Field", "'_", ")_", "(_", "primary", "\\u", "key_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "result", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "8_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "result", "\\u", "code", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "8_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "result", "\\u", "text", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "Char", "Field", "'_", ")_", "(_", "max", "\\u", "length_", "=_", "1023", "_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "transaction", "\\u", "response", "'_", ",_", "self_", "._", "gf_", "(_", "'", "django", ".", "db", ".", "model", "s", ".", "fields", ".", "relate", "d", ".", "Fore", "ign", "Key", "'_", ")_", "(_", "to_", "=_", "orm_", "[_", "'", "authoriz", "ene", "t", ".", "Respons", "e", "'_", "]_", ",_", "null_", "=_", "True_", ",_", "blank_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db_", "._", "send", "\\u", "create", "\\u", "signal_", "(_", "'", "authoriz", "ene", "t", "'_", ",_", "[_", "'", "CI", "MR", "esp", "ons", "e", "'_", "]_", ")_", "\\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", " ", "'", "CI", "MR", "esp", "ons", "e", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
CGATOxford/cgat/CGAT/Expression.py
[ { "content": " def run(self,\n counts,\n design,\n model=None,\n dispersion=None,\n ref_group=None,\n contrasts=None,\n outfile_prefix=None):\n\n if not design.has_replicates and dispersion is None:\n raise ValueError(\"no replicates and no dispersion\")\n\n # create r objects\n r_counts = pandas2ri.py2ri(counts.table)\n r_groups = ro.StrVector(design.conditions)\n r_pairs = ro.StrVector(design.pairs)\n r_has_pairs = ro.default_py2ri(design.has_pairs)\n r_has_replicates = ro.default_py2ri(design.has_replicates)\n\n if dispersion is not None:\n r_dispersion = ro.default_py2ri(dispersion)\n else:\n r_dispersion = ro.default_py2ri(False)\n\n if model is not None:\n r_factors_df = pandas2ri.py2ri(design.factors)\n else:\n r_factors_df = ro.default_py2ri(False)\n\n if ref_group is not None:\n r_ref_group = ro.default_py2ri(ref_group)\n else:\n r_ref_group = ro.default_py2ri(design.groups[0])\n\n if contrasts is not None:\n raise ValueError(\"cannot currently handle user defined contrasts\")\n r_contrasts = ro.default_py2ri(contrasts)\n\n E.info('running EdgeR: groups=%s, pairs=%s, replicates=%s, pairs=%s' %\n (design.groups, design.pairs, design.has_replicates,\n design.has_pairs))\n\n # build DGEList object\n buildDGEList = R('''\n suppressMessages(library('edgeR'))\n\n function(counts, groups, ref_group, factors_df){\n\n countsTable = DGEList(counts, group=groups)\n\n if (factors_df != FALSE){\n for (level in colnames(factors_df)){\n countsTable$samples[level] <- factors_df[level]\n }}\n\n countsTable$samples$group <- relevel(countsTable$samples$group,\n ref = ref_group)\n\n countsTable = calcNormFactors(countsTable)\n\n return(countsTable)}''')\n\n r_countsTable = buildDGEList(r_counts, r_groups,\n r_ref_group, r_factors_df)\n\n # build design matrix\n if model is None:\n buildDesign = R('''\n\n function(countsTable, has_pairs){\n\n if (has_pairs==TRUE) {\n design <- model.matrix( ~pairs + countsTable$samples$group ) }\n\n else {\n design <- model.matrix( ~countsTable$samples$group ) }\n\n return(design)\n }''')\n\n r_design = buildDesign(r_countsTable, r_has_pairs)\n else:\n buildDesign = R('''\n function(factors_df){\n design <- model.matrix(%s, data=factors_df)\n return(design)}''' % model)\n\n r_design = buildDesign(r_factors_df)\n\n # TS - for debugging, remove from final version\n E.info(\"design_table:\")\n E.info(r_design)\n\n # fit model\n fitModel = R('''\n function(countsTable, design, has_replicates, dispersion){\n\n if (has_replicates == TRUE) {\n\n # estimate common dispersion\n countsTable = estimateGLMCommonDisp( countsTable, design )\n\n # estimate trended dispersion\n countsTable <- estimateGLMTrendedDisp( countsTable, design)\n\n # estimate tagwise dispersion\n countsTable = estimateGLMTagwiseDisp( countsTable, design )\n\n # fitting model to each tag\n fit = glmFit( countsTable, design ) }\n\n else {\n # fitting model to each tag\n fit = glmFit(countsTable, design, dispersion=dispersion) }\n\n return(fit)}''')\n\n r_fit = fitModel(r_countsTable, r_design,\n r_has_replicates, r_dispersion)\n\n E.info(\"Conducting liklihood ratio tests\")\n\n # TS - if no contrasts are specified, perform LR test on all possible\n # contrasts, otherwise, only perform the contrasts specified\n # TS - Function definition should depend on whether contrasts\n # are specified (keep the decision tree in python)\n # TS - To do:\n # add lrtTest definition for user-supplied contrasts\n if contrasts is None:\n lrtTest = R('''\n function(fit, prefix, countsTable, design){\n suppressMessages(library(reshape2))\n\n lrt_table_list = NULL\n\n for(coef in seq(2, length(colnames(design)))){\n lrt = glmLRT(fit, coef = coef)\n\n\n lrt_table = lrt$table\n # need to include observations as a seperate column as there will\n # be non-unique\n lrt_table$observation = rownames(lrt_table)\n rownames(lrt_table) <- NULL\n\n lrt_table_list[[coef]] = lrt_table\n lrt_table_list[[coef]]['contrast'] = colnames(design)[coef]\n\n dt <- decideTestsDGE(lrt)\n isDE <- as.logical(dt)\n DEnames <- rownames(fit)[isDE]\n\n contrast = gsub(\":\", \"_interaction_\", colnames(design)[coef])\n png(paste0(contrast, \"MAplot.png\"))\n plotSmear(lrt, de.tags=DEnames, cex=0.35, main=contrast)\n abline(h=c(-1,1), col=\"blue\")\n dev.off()\n }\n\n lrt_final = do.call(rbind, lrt_table_list)\n\n return(lrt_final)}''')\n\n r_lrt_table = lrtTest(r_fit, outfile_prefix,\n r_countsTable, r_design)\n else:\n # TS - shouldn't get to here as error thrown earlier if\n # contrasts is not None\n pass\n\n E.info(\"Generating output - cpm table\")\n\n # output cpm table\n outputCPMTable = R('''function(countsTable, outfile_prefix){\n suppressMessages(library(reshape2))\n countsTable.cpm <- cpm(countsTable, normalized.lib.sizes=TRUE)\n melted <- melt(countsTable.cpm)\n names(melted) <- c(\"test_id\", \"sample\", \"ncpm\")\n\n # melt columns are factors - convert to string for sorting\n melted$test_id = levels(melted$test_id)[as.numeric(melted$test_id)]\n melted$sample = levels(melted$sample)[as.numeric(melted$sample)]\n\n # sort cpm table by test_id and sample\n sorted <- melted[with(melted, order(test_id, sample)),]\n gz <- gzfile(paste0(outfile_prefix,\"cpm.tsv.gz\"), \"w\" )\n write.table(sorted, file=gz, sep = \"\\t\", row.names=FALSE, quote=FALSE)\n close(gz)}''')\n\n outputCPMTable(r_countsTable, outfile_prefix)\n\n result = DEResult_edgeR(testTable=pandas2ri.ri2py(r_lrt_table))\n\n return result", "metadata": "root.DEExperiment_edgeR.run", "header": "['class', 'DEExperiment_edgeR', '(', 'DEExperiment', ')', ':', '___EOS___']", "index": 641 }, { "content": " def run(self,\n counts,\n design,\n model=None,\n dispersion_method=\"pooled\",\n ref_group=None,\n contrasts=None,\n outfile_prefix=None,\n sharing_mode=\"maximum\",\n fit_type=\"parametric\"):\n\n # create r objects\n r_counts = pandas2ri.py2ri(counts.table)\n r_groups = ro.StrVector(design.conditions)\n r_pairs = ro.StrVector(design.pairs)\n r_has_pairs = ro.default_py2ri(design.has_pairs)\n r_has_replicates = ro.default_py2ri(design.has_replicates)\n r_dispersion_method = ro.default_py2ri(dispersion_method)\n r_sharing_mode = ro.default_py2ri(sharing_mode)\n r_fit_type = ro.default_py2ri(fit_type)\n\n if model is not None:\n r_factors_df = pandas2ri.py2ri(design.factors)\n else:\n r_factors_df = ro.default_py2ri(False)\n\n if ref_group is not None:\n r_ref_group = ro.default_py2ri(ref_group)\n else:\n r_ref_group = ro.default_py2ri(design.groups[0])\n\n if contrasts is not None:\n raise ValueError(\"cannot currently handle user defined contrasts\")\n r_contrasts = ro.default_py2ri(contrasts)\n\n if dispersion_method == \"pooled\" and not design.has_replicates:\n E.warn(\"cannot use pooled dispersion without replicates, switching\"\n \" to 'blind dispersion method\")\n r_dispersion_method = ro.default_py2ri(\"blind\")\n\n E.info('running DESeq: groups=%s, pairs=%s, replicates=%s, pairs=%s' %\n (design.groups, design.pairs, design.has_replicates,\n design.has_pairs))\n\n E.info(\"dispersion_method=%s, fit_type=%s, sharing_mode=%s\" %\n (dispersion_method, fit_type, sharing_mode))\n\n # load DESeq\n R('''suppressMessages(library('DESeq'))''')\n\n buildCountDataSet = R('''\n function(counts, groups, dispersion_method, fit_type, sharing_mode){\n\n # create new counts data object for deseq\n cds <- newCountDataSet(counts, groups)\n\n # estimate size factors\n cds <- estimateSizeFactors(cds)\n\n # estimate dispersion\n cds <- estimateDispersions(cds, method=dispersion_method,\n fitType=fit_type, sharingMode=sharing_mode)\n\n }''')\n\n buildCountDataSet(r_counts, r_groups, r_dispersion_method,\n r_fit_type, r_sharing_mode)\n\n result = None\n # result = DEResult_DESeq(testTable=pandas2ri.ri2py(r_lrt_table))\n\n return result", "metadata": "root.DEExperiment_DESeq.run", "header": "['class', 'DEExperiment_DESeq', '(', 'DEExperiment', ')', ':', '___EOS___']", "index": 887 }, { "content": " def __call__(self, probesets,\n treatments,\n controls,\n pattern=None,\n fdr=0.10,\n ngenes=None,\n npermutations=1000,\n ndelta=10,\n method=\"ttest\"):\n\n if ngenes and fdr:\n raise ValueError(\"either supply ngenes or fdr, but not both.\")\n\n R.library(\"samr\")\n\n m = numpy.matrix(treatments + controls)\n m = numpy.transpose(m)\n labels = numpy.array([1] * len(treatments) + [2] * len(controls))\n\n R.assign(\"x\", numpy.array(m))\n R.assign(\"y\", labels)\n R.assign(\"probesets\", probesets)\n\n data = R(\n '''data=list( x=x, y=y, geneid=1:length(probesets), genenames=probesets, logged2=TRUE)''')\n result = R(\n '''samr.obj<-samr(data, resp.type=\"Two class unpaired\", nperms=100)''')\n R('''plot(samr.obj, delta=.4)''')", "metadata": "root.SAMR.__call__", "header": "['class', 'SAMR', '(', 'object', ')', ':', '___EOS___']", "index": 1603 }, { "content": "def deseqParseResults(control_name, treatment_name, fdr, vsd=False):\n '''parse deseq output.\n\n retrieve deseq results from object 'res' in R namespace.\n\n The 'res' object is a dataframe with the following columns (from the\n DESeq manual):\n\n id: The ID of the observable, taken from the row names of the\n counts slots.\n\n baseMean: The base mean (i.e., mean of the counts divided by the size\n factors) for the counts for both conditions\n\n baseMeanA: The base mean (i.e., mean of the counts divided by the size\n factors) for the counts for condition A\n\n baseMeanB: The base mean for condition B\n\n foldChange: The ratio meanB/meanA\n\n log2FoldChange: The log2 of the fold change\n\n pval: The p value for rejecting the null hypothesis 'meanA==meanB'\n\n padj: The adjusted p values (adjusted with 'p.adjust( pval,\n method=\"BH\")')\n\n vsd_log2FoldChange: The log2 fold change after variance stabilization.\n This data field is not part of DESeq proper, but has been added\n in this module in the runDESeq() method.\n\n Here, 'conditionA' is 'control' and 'conditionB' is 'treatment'\n such that a foldChange of 2 means that treatment is twice\n upregulated compared to control.\n\n Returns a list of results.\n\n If vsd is True, the log fold change will be computed from the variance\n stabilized data.\n\n '''\n\n results = []\n isna = R[\"is.na\"]\n\n # Get column names from output and edit\n names = list(R['res'].names)\n m = dict([(x, x) for x in names])\n m.update(dict(\n pval=\"pvalue\",\n baseMeanA=\"value1\",\n baseMeanB=\"value2\",\n id=\"interval_id\",\n log2FoldChange=\"lfold\"))\n\n rtype = collections.namedtuple(\"rtype\", names)\n counts = E.Counter()\n\n for data in zip(*R['res']):\n counts.input += 1\n\n d = rtype._make(data)\n\n # set significant flag\n if d.padj <= fdr:\n signif = 1\n counts.significant += 1\n if d.log2FoldChange > 0:\n counts.significant_over += 1\n else:\n counts.significant_under += 1\n else:\n signif = 0\n counts.insignificant += 1\n\n if d.log2FoldChange > 0:\n counts.all_over += 1\n else:\n counts.all_under += 1\n\n # set lfold change to 0 if both are not expressed\n if d.baseMeanA == 0.0 and d.baseMeanB == 0.0:\n d = d._replace(foldChange=0, log2FoldChange=0)\n\n if d.pval != R('''NA'''):\n status = \"OK\"\n else:\n status = \"FAIL\"\n\n counts[status] += 1\n\n counts.output += 1\n\n # check if our assumptions about the direction of fold change\n # are correct\n assert (d.foldChange > 1) == (d.baseMeanB > d.baseMeanA)\n\n # note that fold change is computed as second group (B) divided by\n # first (A)\n results.append(GeneExpressionResult._make((\n d.id,\n treatment_name,\n d.baseMeanB,\n 0,\n control_name,\n d.baseMeanA,\n 0,\n d.pval,\n d.padj,\n d.log2FoldChange,\n d.foldChange,\n d.transformed_log2FoldChange,\n str(signif),\n status)))\n\n return results, counts", "metadata": "root.deseqParseResults", "header": "['module', '___EOS___']", "index": 2521 }, { "content": "def plotTagStats(infile, design_file, outfile_prefix):\n '''provide summary plots for tag data.'''\n\n loadTagData(infile, design_file)\n\n nobservations, nsamples = filterTagData()\n\n if nobservations == 0:\n E.warn(\"no observations - no output\")\n return\n\n if nsamples == 0:\n E.warn(\"no samples remain after filtering - no output\")\n return\n\n groups, pairs, has_replicates, has_pairs = groupTagData()\n\n # import rpy2.robjects.lib.ggplot2 as ggplot2\n\n R('''suppressMessages(library('ggplot2'))''')\n R('''suppressMessages(library('reshape'))''')\n\n R('''d = melt( log10(countsTable + 1), variable_name = 'sample' )''')\n\n # Note that ggsave does not work if there is\n # X display.\n R.png(outfile_prefix + \".densities.png\")\n R('''gp = ggplot(d)''')\n R('''pp = gp + geom_density(aes(x=value, group=sample,\n color=sample, fill=sample), alpha=I(1/3))''')\n R('''plot(pp)''')\n R['dev.off']()\n\n R.png(outfile_prefix + \".boxplots.png\")\n R('''gp = ggplot(d)''')\n R('''pp = gp +\n geom_boxplot(aes(x=sample,y=value,color=sample,fill=sample),\n size=0.3,\n alpha=I(1/3)) +\n theme(axis.text.x = element_text( angle=90, hjust=1, size=8 ) )''')\n R('''plot(pp)''')\n R['dev.off']()", "metadata": "root.plotTagStats", "header": "['module', '___EOS___']", "index": 3190 }, { "content": "def outputSpikeIns(filename_tags,\n outfile,\n output_filename_pattern,\n filename_design=None,\n foldchange_max=10.0,\n expression_max=5.0,\n max_counts_per_bin=100,\n expression_bin_width=0.5,\n foldchange_bin_width=0.5,\n iterations=1):\n\n E.info(\"loading tag data from %s\" % filename_tags)\n\n if filename_design is not None:\n # load all tag data\n counts_table, design_table = loadTagDataPandas(\n filename_tags, filename_design)\n\n # filter\n counts_table = filterTagDataPandas(counts_table, design_table)\n\n else:\n raise NotImplementedError(\"reading full table not implemented\")\n\n nobservations, nsamples = counts_table.shape\n\n groups = list(set(design_table[\"group\"]))\n if len(groups) != 2:\n raise NotImplementedError(\n \"spike in only implemented for one pairwise comparison\")\n\n # select group data\n group1 = counts_table[design_table[design_table.group == groups[0]].index]\n group2 = counts_table[design_table[design_table.group == groups[1]].index]\n\n outfile.write(\"interval_id\\t%s\\t%s\\n\" %\n (\"\\t\".join(group1.columns), \"\\t\".join(group2.columns)))\n outf_info = IOTools.openFile(output_filename_pattern + \"info.tsv.gz\", \"w\")\n outf_info.write(\"interval_id\\tl10_expression\\tl2fold\\n\")\n\n # important: convert to matrixes, otherwise there will be a per-name lookup\n # when l10average or l2fold are computed.\n group1 = group1.as_matrix()\n group2 = group2.as_matrix()\n\n # compute bins\n expression_bins = numpy.arange(0, expression_max, expression_bin_width)\n fold_change_bins = numpy.arange(-foldchange_max,\n foldchange_max, foldchange_bin_width)\n\n E.info(\"l10expression bins=%s\" % expression_bins)\n E.info(\"l2fold change bins=%s\" % fold_change_bins)\n\n # output values\n output_counts = numpy.zeros(\n (len(expression_bins) + 1, len(fold_change_bins) + 1))\n\n for iteration in range(iterations):\n\n # randomize order\n group1 = numpy.random.permutation(group1)\n group2 = numpy.random.permutation(group2)\n\n # compute means and foldchanges\n group1_mean = group1.mean(1)\n group2_mean = group2.mean(1)\n\n # compute average expression by means\n l10average = numpy.log((group1_mean + group2_mean) / 2.0)\n\n # compute a fold change with pseudo count of 1\n l2fold = numpy.log2((group1_mean + 1.0) / (group2_mean + 1.0))\n\n # digitize arrays with bins\n l10average_idx = numpy.digitize(l10average, expression_bins)\n l2fold_idx = numpy.digitize(l2fold, fold_change_bins)\n\n interval_id = 0\n for idx, coord in enumerate(zip(l10average_idx, l2fold_idx)):\n # assert expression_bins[coord[0]-1] <= l10average[idx] < expression_bins[coord[0]]\n # assert fold_change_bins[coord[1]-1] <= l2fold[idx] < expression_bins[coord[1]]\n\n if output_counts[coord] >= max_counts_per_bin:\n continue\n\n output_counts[coord] += 1\n outf_info.write(\"spike%i\\t%f\\t%f\\n\" % (interval_id,\n l10average[idx],\n l2fold[idx]))\n\n outfile.write(\"spike%i\\t%s\\t%s\\n\" %\n (interval_id,\n \"\\t\".join(\n map(str, list(group1[idx]))),\n \"\\t\".join(map(str, list(group2[idx])))))\n interval_id += 1\n\n outf_info.close()\n\n df = pandas.DataFrame(output_counts)\n df.index = list(expression_bins) + [expression_max]\n df.columns = list(fold_change_bins) + [foldchange_max]\n\n df.to_csv(IOTools.openFile(output_filename_pattern + \"counts.tsv.gz\", \"w\"),\n sep=\"\\t\")\n\n E.info(\"output %i spike in intervals\" % interval_id)", "metadata": "root.outputSpikeIns", "header": "['module', '___EOS___']", "index": 4178 } ]
[ { "span": "r_pairs ", "start_line": 656, "start_column": 8, "end_line": 656, "end_column": 15 }, { "span": "r_pairs ", "start_line": 901, "start_column": 8, "end_line": 901, "end_column": 15 }, { "span": "r_has_pairs ", "start_line": 902, "start_column": 8, "end_line": 902, "end_column": 19 }, { "span": "r_has_replicates ", "start_line": 903, "start_column": 8, "end_line": 903, "end_column": 24 }, { "span": "r_factors_df ", "start_line": 909, "start_column": 12, "end_line": 909, "end_column": 24 }, { "span": "r_factors_df ", "start_line": 911, "start_column": 12, "end_line": 911, "end_column": 24 }, { "span": "r_ref_group ", "start_line": 914, "start_column": 12, "end_line": 914, "end_column": 23 }, { "span": "r_ref_group ", "start_line": 916, "start_column": 12, "end_line": 916, "end_column": 23 }, { "span": "data ", "start_line": 1626, "start_column": 8, "end_line": 1626, "end_column": 12 }, { "span": "result ", "start_line": 1628, "start_column": 8, "end_line": 1628, "end_column": 14 }, { "span": "isna ", "start_line": 2565, "start_column": 4, "end_line": 2565, "end_column": 8 }, { "span": "groups,", "start_line": 3205, "start_column": 4, "end_line": 3205, "end_column": 10 }, { "span": "pairs,", "start_line": 3205, "start_column": 12, "end_line": 3205, "end_column": 17 }, { "span": "has_replicates,", "start_line": 3205, "start_column": 19, "end_line": 3205, "end_column": 33 }, { "span": "has_pairs ", "start_line": 3205, "start_column": 35, "end_line": 3205, "end_column": 44 }, { "span": "nobservations,", "start_line": 4202, "start_column": 4, "end_line": 4202, "end_column": 17 }, { "span": "nsamples ", "start_line": 4202, "start_column": 19, "end_line": 4202, "end_column": 27 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "DE", "Experiment", "\\u", "edge", "R_", "(_", "DE", "Experiment_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "run_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "counts_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "design_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dispersion", "_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ref", "\\u", "group_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "contrast", "s_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outfile", "\\u", "prefix_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "design_", "._", "has", "\\u", "replicate", "s_", "and_", "dispersion", "_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "no", " ", "replicate", "s", " ", "and", " ", "no", " ", "dispersion", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "r", " ", "objects_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "r", "\\u", "counts_", "=_", "panda", "s2", "ri_", "._", "py2", "ri_", "(_", "counts_", "._", "table_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "groups_", "=_", "ro_", "._", "Str", "Vector_", "(_", "design_", "._", "conditions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "pairs_", "=_", "ro_", "._", "Str", "Vector_", "(_", "design_", "._", "pairs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "has", "\\u", "pairs_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "design_", "._", "has", "\\u", "pairs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "has", "\\u", "replicate", "s_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "design_", "._", "has", "\\u", "replicate", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "dispersion", "_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\\u", "dispersion", "_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "dispersion", "_", ")_", "\\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 ", " _", "r", "\\u", "dispersion", "_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "model_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\\u", "factor", "s", "\\u", "df_", "=_", "panda", "s2", "ri_", "._", "py2", "ri_", "(_", "design_", "._", "factors_", ")_", "\\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 ", " _", "r", "\\u", "factor", "s", "\\u", "df_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ref", "\\u", "group_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\\u", "ref", "\\u", "group_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "ref", "\\u", "group_", ")_", "\\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 ", " _", "r", "\\u", "ref", "\\u", "group_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "design_", "._", "groups_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "contrast", "s_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "cann", "ot", " ", "currentl", "y", " ", "handle", " ", "user", " ", "defin", "ed", " ", "contrast", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "contrast", "s_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "contrast", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "E_", "._", "info_", "(_", "'", "runn", "ing", " ", "Ed", "ge", "R", ":", " ", "group", "s", "=", "%", "s", ",", " ", "pair", "s", "=", "%", "s", ",", " ", "replicate", "s", "=", "%", "s", ",", " ", "pair", "s", "=", "%", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "design_", "._", "groups_", ",_", "design_", "._", "pairs_", ",_", "design_", "._", "has", "\\u", "replicate", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "design_", "._", "has", "\\u", "pairs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "build", " ", "DG", "EL", "ist", " ", "object_", "\\u\\u\\uNL\\u\\u\\u_", "build", "DG", "EL", "ist_", "=_", "R_", "(_", "'''", "\\", "10", ";", " ", " ", " ", " ", "suppress", "Messag", "es", "(", "librar", "y", "('", "edge", "R", "'))", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "function", "(", "count", "s", ",", " ", "group", "s", ",", " ", "ref", "\\u", "group", ",", " ", "factor", "s", "\\u", "df", "){", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "count", "s", "Table", " ", "=", " ", "DG", "EL", "ist", "(", "count", "s", ",", " ", "group", "=", "group", "s", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "(", "factor", "s", "\\u", "df", " ", "!=", " ", "FAL", "SE", "){", "\\", "10", ";", " ", " ", "for", " ", "(", "level", " ", "in", " ", "coln", "ames", "(", "factor", "s", "\\u", "df", "))", "{", "\\", "10", ";", " ", " ", " ", " ", "count", "s", "Table", "$", "samples", "[", "level", "]", " ", "<-", " ", "factor", "s", "\\u", "df", "[", "level", "]", "\\", "10", ";", " ", " ", " ", " ", "}}\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "count", "s", "Table", "$", "samples", "$", "group", " ", "<-", " ", "rele", "vel", "(", "count", "s", "Table", "$", "samples", "$", "group", ",", "\\", "10", ";", " ", " ", " ", " ", "ref", " ", "=", " ", "ref", "\\u", "group", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "count", "s", "Table", " ", "=", " ", "calc", "Norm", "Factor", "s", "(", "count", "s", "Table", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "return", "(", "count", "s", "Table", ")}", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r", "\\u", "count", "s", "Table_", "=_", "build", "DG", "EL", "ist_", "(_", "r", "\\u", "counts_", ",_", "r", "\\u", "groups_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "r", "\\u", "ref", "\\u", "group_", ",_", "r", "\\u", "factor", "s", "\\u", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "build", " ", "design", " ", "matrix_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "model_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "build", "Desig", "n_", "=_", "R_", "(_", "'''", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "function", "(", "count", "s", "Table", ",", " ", "has", "\\u", "pair", "s", "){", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "(", "has", "\\u", "pair", "s", "==", "TRU", "E", ")", " ", "{", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "design", " ", "<-", " ", "model", ".", "matrix", "(", " ", "~", "pair", "s", " ", "+", " ", "count", "s", "Table", "$", "samples", "$", "group", " ", ")", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "else", " ", "{", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "design", " ", "<-", " ", "model", ".", "matrix", "(", " ", "~", "count", "s", "Table", "$", "samples", "$", "group", " ", ")", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "return", "(", "design", ")", "\\", "10", ";", " ", " ", " ", " ", "}''", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r", "\\u", "design_", "=_", "build", "Desig", "n_", "(_", "r", "\\u", "count", "s", "Table_", ",_", "r", "\\u", "has", "\\u", "pairs_", ")_", "\\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 ", " _", "build", "Desig", "n_", "=_", "R_", "(_", "'''", "\\", "10", ";", " ", " ", " ", " ", "function", "(", "factor", "s", "\\u", "df", "){", "\\", "10", ";", " ", " ", " ", " ", "design", " ", "<-", " ", "model", ".", "matrix", "(%", "s", ",", " ", "data", "=", "factor", "s", "\\u", "df", ")", "\\", "10", ";", " ", " ", " ", " ", "return", "(", "design", ")}", "'''_", "%_", "model_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r", "\\u", "design_", "=_", "build", "Desig", "n_", "(_", "r", "\\u", "factor", "s", "\\u", "df_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TS", " ", "-", " ", "for", " ", "debugg", "ing", ",", " ", "remove", " ", "from", " ", "final", " ", "version_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "E_", "._", "info_", "(_", "\"", "design", "\\u", "table", ":\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "E_", "._", "info_", "(_", "r", "\\u", "design_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fit", " ", "model_", "\\u\\u\\uNL\\u\\u\\u_", "fit", "Model_", "=_", "R_", "(_", "'''", "\\", "10", ";", " ", " ", " ", " ", "function", "(", "count", "s", "Table", ",", " ", "design", ",", " ", "has", "\\u", "replicate", "s", ",", " ", "dispersion", "){", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "if", " ", "(", "has", "\\u", "replicate", "s", " ", "==", " ", "TRU", "E", ")", " ", "{", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "estimate", " ", "common", " ", "dispersion", "\\", "10", ";", " ", " ", " ", " ", "count", "s", "Table", " ", "=", " ", "estimate", "GL", "MC", "omm", "on", "Disp", "(", " ", "count", "s", "Table", ",", " ", "design", " ", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "estimate", " ", "trend", "ed", " ", "dispersion", "\\", "10", ";", " ", " ", " ", " ", "count", "s", "Table", " ", "<-", " ", "estimate", "GL", "MT", "rend", "ed", "Disp", "(", " ", "count", "s", "Table", ",", " ", "design", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "estimate", " ", "tag", "wis", "e", " ", "dispersion", "\\", "10", ";", " ", " ", " ", " ", "count", "s", "Table", " ", "=", " ", "estimate", "GL", "MT", "ag", "wis", "e", "Disp", "(", " ", "count", "s", "Table", ",", " ", "design", " ", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "fitting", " ", "model", " ", "to", " ", "each", " ", "tag", "\\", "10", ";", " ", " ", " ", " ", "fit", " ", "=", " ", "glm", "Fit", "(", " ", "count", "s", "Table", ",", " ", "design", " ", ")", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "else", " ", "{", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "fitting", " ", "model", " ", "to", " ", "each", " ", "tag", "\\", "10", ";", " ", " ", " ", " ", "fit", " ", "=", " ", "glm", "Fit", "(", "count", "s", "Table", ",", " ", "design", ",", " ", "dispersion", "=", "dispersion", ")", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "return", "(", "fit", ")}", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r", "\\u", "fit_", "=_", "fit", "Model_", "(_", "r", "\\u", "count", "s", "Table_", ",_", "r", "\\u", "design_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "r", "\\u", "has", "\\u", "replicate", "s_", ",_", "r", "\\u", "dispersion", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "E_", "._", "info_", "(_", "\"", "Conduct", "ing", " ", "lik", "li", "hood", " ", "ratio", " ", "tests", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TS", " ", "-", " ", "if", " ", "no", " ", "contrast", "s", " ", "are", " ", "specified", ",", " ", "perform", " ", "LR", " ", "test", " ", "on", " ", "all", " ", "possible_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contrast", "s", ",", " ", "other", "wis", "e", ",", " ", "only", " ", "perform", " ", "the", " ", "contrast", "s", " ", "specified", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TS", " ", "-", " ", "Function", " ", "definit", "ion", " ", "shou", "ld", " ", "depend", " ", "on", " ", "whe", "ther", " ", "contrast", "s_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "are", " ", "specified", " ", "(", "keep", " ", "the", " ", "decision", " ", "tree", " ", "in", " ", "python", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "TS", " ", "-", " ", "To", " ", "do", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "lr", "t", "Test", " ", "definit", "ion", " ", "for", " ", "user", "-", "supplie", "d", " ", "contrast", "s_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "contrast", "s_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "lr", "t", "Test_", "=_", "R_", "(_", "'''", "\\", "10", ";", " ", " ", " ", " ", "function", "(", "fit", ",", " ", "prefix", ",", " ", "count", "s", "Table", ",", " ", "design", "){", "\\", "10", ";", " ", " ", " ", " ", "suppress", "Messag", "es", "(", "librar", "y", "(", "reshape", "2", "))\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "lr", "t", "\\u", "table", "\\u", "list", " ", "=", " ", "NULL", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "for", "(", "coef", " ", "in", " ", "seq", "(", "2", ",", " ", "length", "(", "coln", "ames", "(", "design", "))))", "{", "\\", "10", ";", " ", " ", "lr", "t", " ", "=", " ", "glm", "LR", "T", "(", "fit", ",", " ", "coef", " ", "=", " ", "coef", ")", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", " ", " ", "lr", "t", "\\u", "table", " ", "=", " ", "lr", "t", "$", "table", "\\", "10", ";", " ", " ", "#", " ", "need", " ", "to", " ", "include", " ", "observa", "tion", "s", " ", "as", " ", "a", " ", "seperat", "e", " ", "column", " ", "as", " ", "there", " ", "will", "\\", "10", ";", " ", " ", "#", " ", "be", " ", "non", "-", "unique", "\\", "10", ";", " ", " ", "lr", "t", "\\u", "table", "$", "observa", "tion", " ", "=", " ", "rown", "ames", "(", "lr", "t", "\\u", "table", ")", "\\", "10", ";", " ", " ", "rown", "ames", "(", "lr", "t", "\\u", "table", ")", " ", "<-", " ", "NULL", "\\", "10", ";", "\\", "10", ";", " ", " ", "lr", "t", "\\u", "table", "\\u", "list", "[[", "coef", "]]", " ", "=", " ", "lr", "t", "\\u", "table", "\\", "10", ";", " ", " ", "lr", "t", "\\u", "table", "\\u", "list", "[[", "coef", "]]", "['", "contrast", "']", " ", "=", " ", "coln", "ames", "(", "design", ")[", "coef", "]", "\\", "10", ";", "\\", "10", ";", " ", " ", "dt", " ", "<-", " ", "decide", "Test", "s", "DG", "E", "(", "lr", "t", ")", "\\", "10", ";", " ", " ", "is", "DE", " ", "<-", " ", "as", ".", "logical", "(", "dt", ")", "\\", "10", ";", " ", " ", "DE", "names", " ", "<-", " ", "rown", "ames", "(", "fit", ")[", "is", "DE", "]", "\\", "10", ";", "\\", "10", ";", " ", " ", "contrast", " ", "=", " ", "gsu", "b", "(\"", ":\"", ",", " ", "\"\\u", "interacti", "on", "\\u\"", ",", " ", "coln", "ames", "(", "design", ")[", "coef", "])", "\\", "10", ";", " ", " ", "png", "(", "paste", "0", "(", "contrast", ",", " ", "\"", "MA", "plot", ".", "png", "\"))", "\\", "10", ";", " ", " ", "plot", "Sm", "ear", "(", "lr", "t", ",", " ", "de", ".", "tags", "=", "DE", "names", ",", " ", "ce", "x", "=", "0.35", ",", " ", "main", "=", "contrast", ")", "\\", "10", ";", " ", " ", "abl", "ine", "(", "h", "=", "c", "(-", "1", ",", "1", "),", " ", "col", "=\"", "blue", "\")", "\\", "10", ";", " ", " ", "dev", ".", "off", "()", "\\", "10", ";", " ", " ", " ", " ", "}", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "lr", "t", "\\u", "final", " ", "=", " ", "do", ".", "call", "(", "rbi", "nd", ",", " ", "lr", "t", "\\u", "table", "\\u", "list", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "return", "(", "lr", "t", "\\u", "final", ")}", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r", "\\u", "lr", "t", "\\u", "table_", "=_", "lr", "t", "Test_", "(_", "r", "\\u", "fit_", ",_", "outfile", "\\u", "prefix_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "r", "\\u", "count", "s", "Table_", ",_", "r", "\\u", "design_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "TS", " ", "-", " ", "shou", "ld", "n", "'", "t", " ", "get", " ", "to", " ", "here", " ", "as", " ", "error", " ", "throw", "n", " ", "ear", "lie", "r", " ", "if_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contrast", "s", " ", "is", " ", "not", " ", "None_", "\\u\\u\\uNL\\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_", "E_", "._", "info_", "(_", "\"", "Generat", "ing", " ", "output", " ", "-", " ", "cpm", " ", "table", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", " ", "cpm", " ", "table_", "\\u\\u\\uNL\\u\\u\\u_", "output", "CP", "MT", "able_", "=_", "R_", "(_", "'''", "function", "(", "count", "s", "Table", ",", " ", "outfile", "\\u", "prefix", "){", "\\", "10", ";", " ", " ", " ", " ", "suppress", "Messag", "es", "(", "librar", "y", "(", "reshape", "2", "))\\", "10", ";", " ", " ", " ", " ", "count", "s", "Table", ".", "cpm", " ", "<-", " ", "cpm", "(", "count", "s", "Table", ",", " ", "normali", "zed", ".", "lib", ".", "size", "s", "=", "TRU", "E", ")", "\\", "10", ";", " ", " ", " ", " ", "mel", "ted", " ", "<-", " ", "mel", "t", "(", "count", "s", "Table", ".", "cpm", ")", "\\", "10", ";", " ", " ", " ", " ", "names", "(", "mel", "ted", ")", " ", "<-", " ", "c", "(\"", "test\\u", "id", "\",", " ", "\"", "sample", "\",", " ", "\"", "ncp", "m", "\")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "mel", "t", " ", "column", "s", " ", "are", " ", "factor", "s", " ", "-", " ", "convert", " ", "to", " ", "string", " ", "for", " ", "sorting", "\\", "10", ";", " ", " ", " ", " ", "mel", "ted", "$", "test\\u", "id", " ", "=", " ", "level", "s", "(", "mel", "ted", "$", "test\\u", "id", ")[", "as", ".", "numeri", "c", "(", "mel", "ted", "$", "test\\u", "id", ")]", "\\", "10", ";", " ", " ", " ", " ", "mel", "ted", "$", "sample", " ", "=", " ", "level", "s", "(", "mel", "ted", "$", "sample", ")[", "as", ".", "numeri", "c", "(", "mel", "ted", "$", "sample", ")]", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "sort", " ", "cpm", " ", "table", " ", "by", " ", "test\\u", "id", " ", "and", " ", "sample", "\\", "10", ";", " ", " ", " ", " ", "sorte", "d", " ", "<-", " ", "mel", "ted", "[", "with", "(", "mel", "ted", ",", " ", "order", "(", "test\\u", "id", ",", " ", "sample", "))", ",]", "\\", "10", ";", " ", " ", " ", " ", "gz", " ", "<-", " ", "gz", "file", "(", "paste", "0", "(", "outfile", "\\u", "prefix", ",\"", "cpm", ".", "tsv", ".", "gz", "\")", ",", " ", "\"", "w", "\"", " ", ")", "\\", "10", ";", " ", " ", " ", " ", "write", ".", "table", "(", "sorte", "d", ",", " ", "file", "=", "gz", ",", " ", "sep", " ", "=", " ", "\"\\\\", "t", "\",", " ", "row", ".", "names", "=", "FAL", "SE", ",", " ", "quote", "=", "FAL", "SE", ")", "\\", "10", ";", " ", " ", " ", " ", "close", "(", "gz", ")}", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "output", "CP", "MT", "able_", "(_", "r", "\\u", "count", "s", "Table_", ",_", "outfile", "\\u", "prefix_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "DER", "esult", "\\u", "edge", "R_", "(_", "test", "Table_", "=_", "panda", "s2", "ri_", "._", "ri", "2py", "_", "(_", "r", "\\u", "lr", "t", "\\u", "table_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "DE", "Experiment", "\\u", "DES", "eq_", "(_", "DE", "Experiment_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "run_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "counts_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "design_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "dispersion", "\\u", "method_", "=_", "\"", "pooled", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ref", "\\u", "group_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "contrast", "s_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outfile", "\\u", "prefix_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "shar", "ing", "\\u", "mode_", "=_", "\"", "maxim", "um", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fit", "\\u", "type_", "=_", "\"", "parametr", "ic", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "r", " ", "objects_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\\u", "counts_", "=_", "panda", "s2", "ri_", "._", "py2", "ri_", "(_", "counts_", "._", "table_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "groups_", "=_", "ro_", "._", "Str", "Vector_", "(_", "design_", "._", "conditions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "pairs_", "=_", "ro_", "._", "Str", "Vector_", "(_", "design_", "._", "pairs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "has", "\\u", "pairs_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "design_", "._", "has", "\\u", "pairs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "has", "\\u", "replicate", "s_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "design_", "._", "has", "\\u", "replicate", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "dispersion", "\\u", "method_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "dispersion", "\\u", "method_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "shar", "ing", "\\u", "mode_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "shar", "ing", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "fit", "\\u", "type_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "fit", "\\u", "type_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "model_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\\u", "factor", "s", "\\u", "df_", "=_", "panda", "s2", "ri_", "._", "py2", "ri_", "(_", "design_", "._", "factors_", ")_", "\\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 ", " _", "r", "\\u", "factor", "s", "\\u", "df_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ref", "\\u", "group_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "r", "\\u", "ref", "\\u", "group_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "ref", "\\u", "group_", ")_", "\\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 ", " _", "r", "\\u", "ref", "\\u", "group_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "design_", "._", "groups_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "contrast", "s_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "cann", "ot", " ", "currentl", "y", " ", "handle", " ", "user", " ", "defin", "ed", " ", "contrast", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "contrast", "s_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "contrast", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "dispersion", "\\u", "method_", "==_", "\"", "pooled", "\"_", "and_", "not_", "design_", "._", "has", "\\u", "replicate", "s_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "E_", "._", "warn_", "(_", "\"", "cann", "ot", " ", "use", " ", "pooled", " ", "dispersion", " ", "with", "out", " ", "replicate", "s", ",", " ", "switching", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"", " ", "to", " ", "'", "blind", " ", "dispersion", " ", "method", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "r", "\\u", "dispersion", "\\u", "method_", "=_", "ro_", "._", "default", "\\u", "py2", "ri_", "(_", "\"", "blind", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "E_", "._", "info_", "(_", "'", "runn", "ing", " ", "DES", "eq", ":", " ", "group", "s", "=", "%", "s", ",", " ", "pair", "s", "=", "%", "s", ",", " ", "replicate", "s", "=", "%", "s", ",", " ", "pair", "s", "=", "%", "s", "'_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "design_", "._", "groups_", ",_", "design_", "._", "pairs_", ",_", "design_", "._", "has", "\\u", "replicate", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "design_", "._", "has", "\\u", "pairs_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "E_", "._", "info_", "(_", "\"", "dispersion", "\\u", "method", "=", "%", "s", ",", " ", "fit", "\\u", "type", "=", "%", "s", ",", " ", "shar", "ing", "\\u", "mode", "=", "%", "s", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "dispersion", "\\u", "method_", ",_", "fit", "\\u", "type_", ",_", "shar", "ing", "\\u", "mode_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "load", " ", "DES", "eq_", "\\u\\u\\uNL\\u\\u\\u_", "R_", "(_", "'''", "suppress", "Messag", "es", "(", "librar", "y", "('", "DES", "eq", "'))", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "build", "Count", "Data", "Set_", "=_", "R_", "(_", "'''", "\\", "10", ";", " ", " ", " ", " ", "function", "(", "count", "s", ",", " ", "group", "s", ",", " ", "dispersion", "\\u", "method", ",", " ", "fit", "\\u", "type", ",", " ", "shar", "ing", "\\u", "mode", "){", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "create", " ", "new", " ", "count", "s", " ", "data", " ", "object", " ", "for", " ", "dese", "q", "\\", "10", ";", " ", " ", " ", " ", "cds", " ", "<-", " ", "new", "Count", "Data", "Set", "(", "count", "s", ",", " ", "group", "s", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "estimate", " ", "size", " ", "factor", "s", "\\", "10", ";", " ", " ", " ", " ", "cds", " ", "<-", " ", "estimate", "Size", "Factor", "s", "(", "cds", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "#", " ", "estimate", " ", "dispersion", "\\", "10", ";", " ", " ", " ", " ", "cds", " ", "<-", " ", "estimate", "Disp", "ersi", "ons", "(", "cds", ",", " ", "method", "=", "dispersion", "\\u", "method", ",", "\\", "10", ";", " ", " ", " ", "fit", "Type", "=", "fit", "\\u", "type", ",", " ", "shar", "ing", "Mode", "=", "shar", "ing", "\\u", "mode", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "}''", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "build", "Count", "Data", "Set_", "(_", "r", "\\u", "counts_", ",_", "r", "\\u", "groups_", ",_", "r", "\\u", "dispersion", "\\u", "method_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "r", "\\u", "fit", "\\u", "type_", ",_", "r", "\\u", "shar", "ing", "\\u", "mode_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "result_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "result", " ", "=", " ", "DER", "esult", "\\u", "DES", "eq", "(", "test", "Table", "=", "panda", "s2", "ri", ".", "ri", "2py", "(", "r", "\\u", "lr", "t", "\\u", "table", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "result_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SAM", "R_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "\\u\\u", "call\\u\\u_", "(_", "self_", ",_", "probes", "ets_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "treatment", "s_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "controls_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "pattern_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fd", "r_", "=_", "0.10", "_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ngen", "es_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "npe", "rm", "utat", "ions_", "=_", "1000_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "nde", "lta", "_", "=_", "10_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "method_", "=_", "\"", "tte", "st", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ngen", "es_", "and_", "fd", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Value", "Error_", "(_", "\"", "eit", "her", " ", "supply", " ", "ngen", "es", " ", "or", " ", "fd", "r", ",", " ", "but", " ", "not", " ", "bot", "h", ".\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "R_", "._", "library_", "(_", "\"", "sam", "r", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "m_", "=_", "numpy_", "._", "matrix_", "(_", "treatment", "s_", "+_", "controls_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "numpy_", "._", "transpose_", "(_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "labels_", "=_", "numpy_", "._", "array_", "(_", "[_", "1_", "]_", "*_", "len_", "(_", "treatment", "s_", ")_", "+_", "[_", "2_", "]_", "*_", "len_", "(_", "controls_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "R_", "._", "assign_", "(_", "\"", "x", "\"_", ",_", "numpy_", "._", "array_", "(_", "m_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "._", "assign_", "(_", "\"", "y", "\"_", ",_", "labels_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "._", "assign_", "(_", "\"", "probes", "ets", "\"_", ",_", "probes", "ets_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "R_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "data", "=", "list", "(", " ", "x", "=", "x", ",", " ", "y", "=", "y", ",", " ", "gene", "id", "=", "1", ":", "length", "(", "probes", "ets", "),", " ", "gene", "names", "=", "probes", "ets", ",", " ", "logged", "2", "=", "TRU", "E", ")'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result_", "=_", "R_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'''", "sam", "r", ".", "obj", "<-", "sam", "r", "(", "data", ",", " ", " ", "resp", ".", "type", "=\"", "Tw", "o", " ", "class", " ", "unpa", "ired", "\",", " ", "npe", "rms", "=", "100", ")'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "(_", "'''", "plot", "(", "sam", "r", ".", "obj", ",", " ", "delta", "=.", "4", ")'''_", ")_", "\\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_", "dese", "q", "Pars", "e", "Results_", "(_", "control", "\\u", "name_", ",_", "treatment", "\\u", "name_", ",_", "fd", "r_", ",_", "vs", "d_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "parse", " ", "dese", "q", " ", "output", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "retrieve", " ", "dese", "q", " ", "results", " ", "from", " ", "object", " ", "'", "res", "'", " ", "in", " ", "R", " ", "namespace", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "'", "res", "'", " ", "object", " ", "is", " ", "a", " ", "dataframe", " ", "with", " ", "the", " ", "follow", "ing", " ", "column", "s", " ", "(", "from", " ", "the", "\\", "10", ";", " ", " ", " ", " ", "DES", "eq", " ", "manu", "al", "):", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "id", ":", " ", "The", " ", "ID", " ", "of", " ", "the", " ", "observable", ",", " ", "take", "n", " ", "from", " ", "the", " ", "row", " ", "names", " ", "of", " ", "the", "\\", "10", ";", " ", " ", "count", "s", " ", "slot", "s", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "base", "Mea", "n", ":", " ", "The", " ", "base", " ", "mean", " ", "(", "i", ".", "e", ".,", " ", "mean", " ", "of", " ", "the", " ", "count", "s", " ", "divide", "d", " ", "by", " ", "the", " ", "size", "\\", "10", ";", " ", " ", "factor", "s", ")", " ", "for", " ", "the", " ", "count", "s", " ", "for", " ", "bot", "h", " ", "condition", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "base", "Mea", "n", "A", ":", " ", "The", " ", "base", " ", "mean", " ", "(", "i", ".", "e", ".,", " ", "mean", " ", "of", " ", "the", " ", "count", "s", " ", "divide", "d", " ", "by", " ", "the", " ", "size", "\\", "10", ";", " ", " ", "factor", "s", ")", " ", "for", " ", "the", " ", "count", "s", " ", "for", " ", "condition", " ", "A", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "base", "Mea", "n", "B", ":", " ", "The", " ", "base", " ", "mean", " ", "for", " ", "condition", " ", "B", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "fold", "Change", ":", " ", "The", " ", "ratio", " ", "mean", "B", "/", "mean", "A", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "log", "2", "Fold", "Change", ":", " ", "The", " ", "log", "2", " ", "of", " ", "the", " ", "fold", " ", "change", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "pval", ":", " ", "The", " ", "p", " ", "value", " ", "for", " ", "reject", "ing", " ", "the", " ", "null", " ", "hypothesis", " ", "'", "mean", "A", "==", "mean", "B", "'", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "pad", "j", ":", " ", "The", " ", "adjusted", " ", "p", " ", "values", " ", "(", "adjusted", " ", "with", " ", "'", "p", ".", "adjust", "(", " ", "pval", ",", "\\", "10", ";", " ", " ", "method", "=\"", "BH", "\")", "')", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "vs", "d\\u", "log", "2", "Fold", "Change", ":", " ", "The", " ", "log", "2", " ", "fold", " ", "change", " ", "after", " ", "varian", "ce", " ", "stab", "iliz", "ation", ".", "\\", "10", ";", " ", " ", "Thi", "s", " ", "data", " ", "field", " ", "is", " ", "not", " ", "part", " ", "of", " ", "DES", "eq", " ", "proper", ",", " ", "but", " ", "has", " ", "bee", "n", " ", "adde", "d", "\\", "10", ";", " ", " ", "in", " ", "this", " ", "module", " ", "in", " ", "the", " ", "run", "DES", "eq", "()", " ", "method", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Her", "e", ",", " ", "'", "condition", "A", "'", " ", "is", " ", "'", "control", "'", " ", "and", " ", "'", "condition", "B", "'", " ", "is", " ", "'", "treatment", "'", "\\", "10", ";", " ", " ", " ", " ", "suc", "h", " ", "tha", "t", " ", "a", " ", "fold", "Change", " ", "of", " ", "2", " ", "means", " ", "tha", "t", " ", "treatment", " ", "is", " ", "twi", "ce", "\\", "10", ";", " ", " ", " ", " ", "upr", "eg", "ulate", "d", " ", "compare", "d", " ", "to", " ", "control", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Return", "s", " ", "a", " ", "list", " ", "of", " ", "results", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "If", " ", "vs", "d", " ", "is", " ", "Tru", "e", ",", " ", "the", " ", "log", " ", "fold", " ", "change", " ", "will", " ", "be", " ", "compute", "d", " ", "from", " ", "the", " ", "varian", "ce", "\\", "10", ";", " ", " ", " ", " ", "stab", "iliz", "ed", " ", "data", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "isn", "a_", "=_", "R_", "[_", "\"", "is", ".", "na", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Get", " ", "column", " ", "names", " ", "from", " ", "output", " ", "and", " ", "edit_", "\\u\\u\\uNL\\u\\u\\u_", "names_", "=_", "list_", "(_", "R_", "[_", "'", "res", "'_", "]_", "._", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "=_", "dict_", "(_", "[_", "(_", "x_", ",_", "x_", ")_", "for_", "x_", "in_", "names_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "m_", "._", "update_", "(_", "dict_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "pval_", "=_", "\"", "pvalue", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "base", "Mea", "n", "A_", "=_", "\"", "value", "1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "base", "Mea", "n", "B_", "=_", "\"", "value", "2", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "id_", "=_", "\"", "interval", "\\u", "id", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "log", "2", "Fold", "Change_", "=_", "\"", "lf", "old", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rtype_", "=_", "collections_", "._", "namedtuple_", "(_", "\"", "rty", "pe", "\"_", ",_", "names_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counts_", "=_", "E_", "._", "Counter_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "data_", "in_", "zip_", "(_", "*_", "R_", "[_", "'", "res", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counts_", "._", "input_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "=_", "rtype_", "._", "\\u", "make_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "significant", " ", "flag_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "d_", "._", "pad", "j_", "<=_", "fd", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sign", "if_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counts_", "._", "significant", "_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "d_", "._", "log", "2", "Fold", "Change_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counts_", "._", "significant", "\\u", "over_", "+=_", "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 ", " _", "counts_", "._", "significant", "\\u", "under", "_", "+=_", "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 ", " _", "sign", "if_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "counts_", "._", "insi", "gni", "fica", "nt_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "d_", "._", "log", "2", "Fold", "Change_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "counts_", "._", "all", "\\u", "over_", "+=_", "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 ", " _", "counts_", "._", "all", "\\u", "under", "_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "set", " ", "lf", "old", " ", "change", " ", "to", " ", "0", " ", "if", " ", "bot", "h", " ", "are", " ", "not", " ", "express", "ed_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "d_", "._", "base", "Mea", "n", "A_", "==_", "0.0_", "and_", "d_", "._", "base", "Mea", "n", "B_", "==_", "0.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "d_", "=_", "d_", "._", "\\u", "replace_", "(_", "fold", "Change_", "=_", "0_", ",_", "log", "2", "Fold", "Change_", "=_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "d_", "._", "pval_", "!=_", "R_", "(_", "'''", "NA", "'''_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "status_", "=_", "\"", "OK", "\"_", "\\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 ", " _", "status_", "=_", "\"", "FAIL", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "counts_", "[_", "status_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "counts_", "._", "output_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "check", " ", "if", " ", "our", " ", "assumption", "s", " ", "abo", "ut", " ", "the", " ", "direction", " ", "of", " ", "fold", " ", "change_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "are", " ", "correct_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "(_", "d_", "._", "fold", "Change_", ">_", "1_", ")_", "==_", "(_", "d_", "._", "base", "Mea", "n", "B_", ">_", "d_", "._", "base", "Mea", "n", "A_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "note", " ", "tha", "t", " ", "fold", " ", "change", " ", "is", " ", "compute", "d", " ", "as", " ", "second", " ", "group", " ", "(", "B", ")", " ", "divide", "d", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "first", " ", "(", "A", ")_", "\\u\\u\\uNL\\u\\u\\u_", "results_", "._", "append_", "(_", "Gene", "Expression", "Result_", "._", "\\u", "make_", "(_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "treatment", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "base", "Mea", "n", "B_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "control", "\\u", "name_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "base", "Mea", "n", "A_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "pval_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "pad", "j_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "log", "2", "Fold", "Change_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "fold", "Change_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "d_", "._", "transforme", "d\\u", "log", "2", "Fold", "Change_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "str_", "(_", "sign", "if_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "status_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "results_", ",_", "counts_", "\\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_", "plot", "Ta", "g", "Stats_", "(_", "infile_", ",_", "design", "\\u", "file_", ",_", "outfile", "\\u", "prefix_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "provide", " ", "summar", "y", " ", "plots", " ", "for", " ", "tag", " ", "data", ".'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "load", "Ta", "g", "Data_", "(_", "infile_", ",_", "design", "\\u", "file_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "nob", "serv", "ations_", ",_", "nsamples", "_", "=_", "filter", "Ta", "g", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "nob", "serv", "ations_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "E_", "._", "warn_", "(_", "\"", "no", " ", "observa", "tion", "s", " ", "-", " ", "no", " ", "output", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "nsamples", "_", "==_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "E_", "._", "warn_", "(_", "\"", "no", " ", "samples", " ", "rema", "in", " ", "after", " ", "filtering", " ", "-", " ", "no", " ", "output", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "groups_", ",_", "pairs_", ",_", "has", "\\u", "replicate", "s_", ",_", "has", "\\u", "pairs_", "=_", "group", "Ta", "g", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "import", " ", "rpy", "2", ".", "robj", "ect", "s", ".", "lib", ".", "gg", "plot", "2", " ", "as", " ", "gg", "plot", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "R_", "(_", "'''", "suppress", "Messag", "es", "(", "librar", "y", "('", "gg", "plot", "2", "'))", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "(_", "'''", "suppress", "Messag", "es", "(", "librar", "y", "('", "reshape", "'))", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "R_", "(_", "'''", "d", " ", "=", " ", "mel", "t", "(", " ", "log", "10", "(", "count", "s", "Table", " ", "+", " ", "1", "),", " ", "variab", "le", "\\u", "name", " ", "=", " ", "'", "sample", "'", " ", ")'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "tha", "t", " ", "gg", "save", " ", "doe", "s", " ", "not", " ", "work", " ", "if", " ", "there", " ", "is_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "X", " ", "display", "._", "\\u\\u\\uNL\\u\\u\\u_", "R_", "._", "png_", "(_", "outfile", "\\u", "prefix_", "+_", "\".", "densit", "ies", ".", "png", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "(_", "'''", "gp", " ", "=", " ", "gg", "plot", "(", "d", ")'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "(_", "'''", "pp", " ", "=", " ", "gp", " ", "+", " ", "geom", "\\u", "densit", "y", "(", "aes", "(", "x", "=", "value", ",", " ", "group", "=", "sample", ",", "\\", "10", ";", " ", " ", " ", " ", "color", "=", "sample", ",", " ", "fill", "=", "sample", "),", " ", "alpha", "=", "I", "(", "1", "/", "3", "))", "'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "(_", "'''", "plot", "(", "pp", ")'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "[_", "'", "dev", ".", "off", "'_", "]_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "R_", "._", "png_", "(_", "outfile", "\\u", "prefix_", "+_", "\".", "box", "plots", ".", "png", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "(_", "'''", "gp", " ", "=", " ", "gg", "plot", "(", "d", ")'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "(_", "'''", "pp", " ", "=", " ", "gp", " ", "+", "\\", "10", ";", " ", " ", " ", " ", "geom", "\\u", "box", "plot", "(", "aes", "(", "x", "=", "sample", ",", "y", "=", "value", ",", "color", "=", "sample", ",", "fill", "=", "sample", "),", "\\", "10", ";", " ", " ", " ", " ", "size", "=", "0.", "3", ",", "\\", "10", ";", " ", " ", " ", " ", "alpha", "=", "I", "(", "1", "/", "3", "))", " ", "+", "\\", "10", ";", " ", " ", " ", " ", "them", "e", "(", "axis", ".", "text", ".", "x", " ", "=", " ", "element", "\\u", "text", "(", " ", "angle", "=", "90", ",", " ", "hj", "ust", "=", "1", ",", " ", "size", "=", "8", " ", ")", " ", ")'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "(_", "'''", "plot", "(", "pp", ")'''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "R_", "[_", "'", "dev", ".", "off", "'_", "]_", "(_", ")_", "\\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_", "output", "Spike", "Ins", "_", "(_", "filename", "\\u", "tags_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "outfile_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "output", "\\u", "filename", "\\u", "pattern_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filename", "\\u", "design_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fold", "change", "\\u", "max_", "=_", "10.0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "express", "ion", "\\u", "max_", "=_", "5.0_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "max", "\\u", "count", "s", "\\u", "per", "\\u", "bin_", "=_", "100_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "express", "ion", "\\u", "bin", "\\u", "width_", "=_", "0.5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fold", "change", "\\u", "bin", "\\u", "width_", "=_", "0.5_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "iterations_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "E_", "._", "info_", "(_", "\"", "load", "ing", " ", "tag", " ", "data", " ", "from", " ", "%", "s", "\"_", "%_", "filename", "\\u", "tags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "filename", "\\u", "design_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "load", " ", "all", " ", "tag", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "count", "s", "\\u", "table_", ",_", "design", "\\u", "table_", "=_", "load", "Ta", "g", "Data", "Pan", "das_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "filename", "\\u", "tags_", ",_", "filename", "\\u", "design_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "filter_", "\\u\\u\\uNL\\u\\u\\u_", "count", "s", "\\u", "table_", "=_", "filter", "Ta", "g", "Data", "Pan", "das_", "(_", "count", "s", "\\u", "table_", ",_", "design", "\\u", "table_", ")_", "\\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 ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\"", "readi", "ng", " ", "full", " ", "table", " ", "not", " ", "implemented", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "nob", "serv", "ations_", ",_", "nsamples", "_", "=_", "count", "s", "\\u", "table_", "._", "shape_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "groups_", "=_", "list_", "(_", "set_", "(_", "design", "\\u", "table_", "[_", "\"", "group", "\"_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "groups_", ")_", "!=_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Not", "Impl", "ement", "ed", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "spike", " ", "in", " ", "only", " ", "implemented", " ", "for", " ", "one", " ", "pairwise", " ", "compa", "ris", "on", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "select", " ", "group", " ", "data_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "group1_", "=_", "count", "s", "\\u", "table_", "[_", "design", "\\u", "table_", "[_", "design", "\\u", "table_", "._", "group_", "==_", "groups_", "[_", "0_", "]_", "]_", "._", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group2_", "=_", "count", "s", "\\u", "table_", "[_", "design", "\\u", "table_", "[_", "design", "\\u", "table_", "._", "group_", "==_", "groups_", "[_", "1_", "]_", "]_", "._", "index_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "outfile_", "._", "write_", "(_", "\"", "interval", "\\u", "id", "\\\\", "t", "%", "s", "\\\\", "t", "%", "s", "\\\\", "n", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"\\\\", "t", "\"_", "._", "join_", "(_", "group1_", "._", "columns_", ")_", ",_", "\"\\\\", "t", "\"_", "._", "join_", "(_", "group2_", "._", "columns_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outf", "\\u", "info_", "=_", "IO", "Tools_", "._", "open", "File_", "(_", "output", "\\u", "filename", "\\u", "pattern_", "+_", "\"", "info", ".", "tsv", ".", "gz", "\"_", ",_", "\"", "w", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outf", "\\u", "info_", "._", "write_", "(_", "\"", "interval", "\\u", "id", "\\\\", "tl", "10", "\\u", "express", "ion", "\\\\", "tl", "2f", "old", "\\\\", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "importa", "nt", ":", " ", "convert", " ", "to", " ", "matrix", "es", ",", " ", "other", "wis", "e", " ", "there", " ", "will", " ", "be", " ", "a", " ", "per", "-", "name", " ", "lookup_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "whe", "n", " ", "l10", "averag", "e", " ", "or", " ", "l2", "fold", " ", "are", " ", "compute", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "group1_", "=_", "group1_", "._", "as", "\\u", "matrix_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group2_", "=_", "group2_", "._", "as", "\\u", "matrix_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compute", " ", "bins_", "\\u\\u\\uNL\\u\\u\\u_", "express", "ion", "\\u", "bins_", "=_", "numpy_", "._", "arange_", "(_", "0_", ",_", "express", "ion", "\\u", "max_", ",_", "express", "ion", "\\u", "bin", "\\u", "width_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fold", "\\u", "change", "\\u", "bins_", "=_", "numpy_", "._", "arange_", "(_", "-_", "fold", "change", "\\u", "max_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "fold", "change", "\\u", "max_", ",_", "fold", "change", "\\u", "bin", "\\u", "width_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "E_", "._", "info_", "(_", "\"", "l10", "express", "ion", " ", "bins", "=", "%", "s", "\"_", "%_", "express", "ion", "\\u", "bins_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "E_", "._", "info_", "(_", "\"", "l2", "fold", " ", "change", " ", "bins", "=", "%", "s", "\"_", "%_", "fold", "\\u", "change", "\\u", "bins_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", " ", "values_", "\\u\\u\\uNL\\u\\u\\u_", "output", "\\u", "counts_", "=_", "numpy_", "._", "zeros_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "len_", "(_", "express", "ion", "\\u", "bins_", ")_", "+_", "1_", ",_", "len_", "(_", "fold", "\\u", "change", "\\u", "bins_", ")_", "+_", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "iteration_", "in_", "range_", "(_", "iterations_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "randomize", " ", "order_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "group1_", "=_", "numpy_", "._", "random_", "._", "permutation_", "(_", "group1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group2_", "=_", "numpy_", "._", "random_", "._", "permutation_", "(_", "group2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compute", " ", "means", " ", "and", " ", "fold", "changes_", "\\u\\u\\uNL\\u\\u\\u_", "group", "1", "\\u", "mean_", "=_", "group1_", "._", "mean_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "group", "2", "\\u", "mean_", "=_", "group2_", "._", "mean_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compute", " ", "averag", "e", " ", "express", "ion", " ", "by", " ", "means_", "\\u\\u\\uNL\\u\\u\\u_", "l10", "average_", "=_", "numpy_", "._", "log_", "(_", "(_", "group", "1", "\\u", "mean_", "+_", "group", "2", "\\u", "mean_", ")_", "/_", "2.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "compute", " ", "a", " ", "fold", " ", "change", " ", "with", " ", "pseudo", " ", "count", " ", "of", " ", "1_", "\\u\\u\\uNL\\u\\u\\u_", "l2", "fold_", "=_", "numpy_", "._", "log2_", "(_", "(_", "group", "1", "\\u", "mean_", "+_", "1.0_", ")_", "/_", "(_", "group", "2", "\\u", "mean_", "+_", "1.0_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "digit", "ize", " ", "arrays", " ", "with", " ", "bins_", "\\u\\u\\uNL\\u\\u\\u_", "l10", "averag", "e\\u", "idx_", "=_", "numpy_", "._", "digit", "ize_", "(_", "l10", "average_", ",_", "express", "ion", "\\u", "bins_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "l2", "fold", "\\u", "idx_", "=_", "numpy_", "._", "digit", "ize_", "(_", "l2", "fold_", ",_", "fold", "\\u", "change", "\\u", "bins_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "interval", "\\u", "id_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "idx_", ",_", "coord_", "in_", "enumerate_", "(_", "zip_", "(_", "l10", "averag", "e\\u", "idx_", ",_", "l2", "fold", "\\u", "idx_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "assert", " ", "express", "ion", "\\u", "bins", "[", "coord", "[", "0", "]-", "1", "]", " ", "<=", " ", "l10", "averag", "e", "[", "idx", "]", " ", "<", " ", "express", "ion", "\\u", "bins", "[", "coord", "[", "0", "]]", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "assert", " ", "fold", "\\u", "change", "\\u", "bins", "[", "coord", "[", "1", "]-", "1", "]", " ", "<=", " ", "l2", "fold", "[", "idx", "]", " ", "<", " ", " ", "express", "ion", "\\u", "bins", "[", "coord", "[", "1", "]]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "output", "\\u", "counts_", "[_", "coord_", "]_", ">=_", "max", "\\u", "count", "s", "\\u", "per", "\\u", "bin_", ":_", "\\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_", "output", "\\u", "counts_", "[_", "coord_", "]_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "outf", "\\u", "info_", "._", "write_", "(_", "\"", "spike", "%", "i", "\\\\", "t", "%", "f", "\\\\", "t", "%", "f", "\\\\", "n", "\"_", "%_", "(_", "interval", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "l10", "average_", "[_", "idx_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "l2", "fold_", "[_", "idx_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "outfile_", "._", "write_", "(_", "\"", "spike", "%", "i", "\\\\", "t", "%", "s", "\\\\", "t", "%", "s", "\\\\", "n", "\"_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "interval", "\\u", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"\\\\", "t", "\"_", "._", "join_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "map_", "(_", "str_", ",_", "list_", "(_", "group1_", "[_", "idx_", "]_", ")_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"\\\\", "t", "\"_", "._", "join_", "(_", "map_", "(_", "str_", ",_", "list_", "(_", "group2_", "[_", "idx_", "]_", ")_", ")_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "interval", "\\u", "id_", "+=_", "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_", "outf", "\\u", "info_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "df_", "=_", "pandas_", "._", "Data", "Frame_", "(_", "output", "\\u", "counts_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df_", "._", "index_", "=_", "list_", "(_", "express", "ion", "\\u", "bins_", ")_", "+_", "[_", "express", "ion", "\\u", "max_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "df_", "._", "columns_", "=_", "list_", "(_", "fold", "\\u", "change", "\\u", "bins_", ")_", "+_", "[_", "fold", "change", "\\u", "max_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "df_", "._", "to", "\\u", "csv_", "(_", "IO", "Tools_", "._", "open", "File_", "(_", "output", "\\u", "filename", "\\u", "pattern_", "+_", "\"", "count", "s", ".", "tsv", ".", "gz", "\"_", ",_", "\"", "w", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "sep_", "=_", "\"\\\\", "t", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "E_", "._", "info_", "(_", "\"", "output", " ", "%", "i", " ", "spike", " ", "in", " ", "interval", "s", "\"_", "%_", "interval", "\\u", "id_", ")_" ]
[ 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, 0, 1, 1, 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 ]
Except block handles 'BaseException'
aldro61/pu-learning/src/puLearning/puAdapter.py
[ { "content": " def __fit_precomputed_kernel(self, X, y):\n \"\"\"\n Fits an estimator of p(s=1|x) and estimates the value of p(s=1|y=1) using a subset of the training examples\n\n X -- Precomputed kernel matrix\n y -- Labels associated to each example in X (Positive label: 1.0, Negative label: -1.0)\n \"\"\"\n positives = np.where(y == 1.)[0]\n hold_out_size = np.ceil(len(positives) * self.hold_out_ratio)\n\n if len(positives) <= hold_out_size:\n raise('Not enough positive examples to estimate p(s=1|y=1,x). Need at least ' + str(hold_out_size + 1) + '.')\n \n np.random.shuffle(positives)\n hold_out = positives[:hold_out_size]\n \n #Hold out test kernel matrix\n X_test_hold_out = X[hold_out]\n keep = list(set(np.arange(len(y))) - set(hold_out))\n X_test_hold_out = X_test_hold_out[:,keep]\n \n #New training kernel matrix\n X = X[:, keep]\n X = X[keep]\n\n y = np.delete(y, hold_out)\n \n self.estimator.fit(X, y)\n \n hold_out_predictions = self.estimator.predict_proba(X_test_hold_out)\n \n try:\n hold_out_predictions = hold_out_predictions[:,1]\n except:\n pass\n \n c = np.mean(hold_out_predictions)\n self.c = c\n \n self.estimator_fitted = True", "metadata": "root.PUAdapter.__fit_precomputed_kernel", "header": "['class', 'PUAdapter', '(', 'object', ')', ':', '___EOS___']", "index": 47 }, { "content": " def __fit_no_precomputed_kernel(self, X, y):\n \"\"\"\n Fits an estimator of p(s=1|x) and estimates the value of p(s=1|y=1,x)\n\n X -- List of feature vectors\n y -- Labels associated to each feature vector in X (Positive label: 1.0, Negative label: -1.0)\n \"\"\"\n positives = np.where(y == 1.)[0]\n hold_out_size = np.ceil(len(positives) * self.hold_out_ratio)\n\n if len(positives) <= hold_out_size:\n raise('Not enough positive examples to estimate p(s=1|y=1,x). Need at least ' + str(hold_out_size + 1) + '.')\n \n np.random.shuffle(positives)\n hold_out = positives[:hold_out_size]\n X_hold_out = X[hold_out]\n X = np.delete(X, hold_out,0)\n y = np.delete(y, hold_out)\n \n self.estimator.fit(X, y)\n \n hold_out_predictions = self.estimator.predict_proba(X_hold_out)\n \n try:\n hold_out_predictions = hold_out_predictions[:,1]\n except:\n pass\n \n c = np.mean(hold_out_predictions)\n self.c = c\n\n self.estimator_fitted = True", "metadata": "root.PUAdapter.__fit_no_precomputed_kernel", "header": "['class', 'PUAdapter', '(', 'object', ')', ':', '___EOS___']", "index": 89 }, { "content": " def predict_proba(self, X):\n \"\"\"\n Predicts p(y=1|x) using the estimator and the value of p(s=1|y=1) estimated in fit(...)\n\n X -- List of feature vectors or a precomputed kernel matrix\n \"\"\"\n if not self.estimator_fitted:\n raise Exception('The estimator must be fitted before calling predict_proba(...).')\n\n probabilistic_predictions = self.estimator.predict_proba(X)\n \n try:\n probabilistic_predictions = probabilistic_predictions[:,1]\n except:\n pass\n \n return probabilistic_predictions / self.c", "metadata": "root.PUAdapter.predict_proba", "header": "['class', 'PUAdapter', '(', 'object', ')', ':', '___EOS___']", "index": 123 } ]
[ { "span": "except:", "start_line": 80, "start_column": 8, "end_line": 80, "end_column": 15 }, { "span": "except:", "start_line": 114, "start_column": 8, "end_line": 114, "end_column": 15 }, { "span": "except:", "start_line": 136, "start_column": 8, "end_line": 136, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "PU", "Adapter_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "fit", "\\u", "precompute", "d\\u", "kernel_", "(_", "self_", ",_", "X_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Fit", "s", " ", "an", " ", "esti", "mat", "or", " ", "of", " ", "p", "(", "s", "=", "1", "|", "x", ")", " ", "and", " ", "estimate", "s", " ", "the", " ", "value", " ", "of", " ", "p", "(", "s", "=", "1", "|", "y", "=", "1", ")", " ", "usi", "ng", " ", "a", " ", "subse", "t", " ", "of", " ", "the", " ", "train", "ing", " ", "example", "s", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "X", " ", "--", " ", "Prec", "omp", "ute", "d", " ", "kernel", " ", "matrix", "\\", "10", ";", " ", " ", " ", " ", "y", " ", "--", " ", "Label", "s", " ", "associate", "d", " ", "to", " ", "each", " ", "example", " ", "in", " ", "X", " ", "(", "Posi", "tiv", "e", " ", "label", ":", " ", "1.0", ",", " ", "Nega", "tiv", "e", " ", "label", ":", " ", "-1", ".0", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "positives", "_", "=_", "np_", "._", "where_", "(_", "y_", "==_", "1._", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hold", "\\u", "out", "\\u", "size_", "=_", "np_", "._", "ceil_", "(_", "len_", "(_", "positives", "_", ")_", "*_", "self_", "._", "hold", "\\u", "out", "\\u", "ratio_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "positives", "_", ")_", "<=_", "hold", "\\u", "out", "\\u", "size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "(_", "'", "Not", " ", "eno", "ugh", " ", "posit", "ive", " ", "example", "s", " ", "to", " ", "estimate", " ", "p", "(", "s", "=", "1", "|", "y", "=", "1", ",", "x", ").", " ", "Ne", "ed", " ", "at", " ", "leas", "t", " ", "'_", "+_", "str_", "(_", "hold", "\\u", "out", "\\u", "size_", "+_", "1_", ")_", "+_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "np_", "._", "random_", "._", "shuffle_", "(_", "positives", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hold", "\\u", "out_", "=_", "positives", "_", "[_", ":_", "hold", "\\u", "out", "\\u", "size_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "Hold", " ", "out", " ", "test", " ", "kernel", " ", "matrix_", "\\u\\u\\uNL\\u\\u\\u_", "X", "\\u", "test\\u", "hold", "\\u", "out_", "=_", "X_", "[_", "hold", "\\u", "out_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "keep_", "=_", "list_", "(_", "set_", "(_", "np_", "._", "arange_", "(_", "len_", "(_", "y_", ")_", ")_", ")_", "-_", "set_", "(_", "hold", "\\u", "out_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X", "\\u", "test\\u", "hold", "\\u", "out_", "=_", "X", "\\u", "test\\u", "hold", "\\u", "out_", "[_", ":_", ",_", "keep_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "New", " ", "train", "ing", " ", "kernel", " ", "matrix_", "\\u\\u\\uNL\\u\\u\\u_", "X_", "=_", "X_", "[_", ":_", ",_", "keep_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", "=_", "X_", "[_", "keep_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "y_", "=_", "np_", "._", "delete_", "(_", "y_", ",_", "hold", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "estimator_", "._", "fit_", "(_", "X_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hold", "\\u", "out", "\\u", "predictions_", "=_", "self_", "._", "estimator_", "._", "predi", "ct", "\\u", "proba_", "(_", "X", "\\u", "test\\u", "hold", "\\u", "out_", ")_", "\\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 ", " _", "hold", "\\u", "out", "\\u", "predictions_", "=_", "hold", "\\u", "out", "\\u", "predictions_", "[_", ":_", ",_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "=_", "np_", "._", "mean_", "(_", "hold", "\\u", "out", "\\u", "predictions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "c_", "=_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "esti", "mat", "or", "\\u", "fitted", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PU", "Adapter_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "fit", "\\u", "no", "\\u", "precompute", "d\\u", "kernel_", "(_", "self_", ",_", "X_", ",_", "y_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Fit", "s", " ", "an", " ", "esti", "mat", "or", " ", "of", " ", "p", "(", "s", "=", "1", "|", "x", ")", " ", "and", " ", "estimate", "s", " ", "the", " ", "value", " ", "of", " ", "p", "(", "s", "=", "1", "|", "y", "=", "1", ",", "x", ")", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "X", " ", "--", " ", "List", " ", "of", " ", "feature", " ", "vector", "s", "\\", "10", ";", " ", " ", " ", " ", "y", " ", "--", " ", "Label", "s", " ", "associate", "d", " ", "to", " ", "each", " ", "feature", " ", "vector", " ", "in", " ", "X", " ", "(", "Posi", "tiv", "e", " ", "label", ":", " ", "1.0", ",", " ", "Nega", "tiv", "e", " ", "label", ":", " ", "-1", ".0", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "positives", "_", "=_", "np_", "._", "where_", "(_", "y_", "==_", "1._", ")_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hold", "\\u", "out", "\\u", "size_", "=_", "np_", "._", "ceil_", "(_", "len_", "(_", "positives", "_", ")_", "*_", "self_", "._", "hold", "\\u", "out", "\\u", "ratio_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len_", "(_", "positives", "_", ")_", "<=_", "hold", "\\u", "out", "\\u", "size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "(_", "'", "Not", " ", "eno", "ugh", " ", "posit", "ive", " ", "example", "s", " ", "to", " ", "estimate", " ", "p", "(", "s", "=", "1", "|", "y", "=", "1", ",", "x", ").", " ", "Ne", "ed", " ", "at", " ", "leas", "t", " ", "'_", "+_", "str_", "(_", "hold", "\\u", "out", "\\u", "size_", "+_", "1_", ")_", "+_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "np_", "._", "random_", "._", "shuffle_", "(_", "positives", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hold", "\\u", "out_", "=_", "positives", "_", "[_", ":_", "hold", "\\u", "out", "\\u", "size_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X", "\\u", "hold", "\\u", "out_", "=_", "X_", "[_", "hold", "\\u", "out_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "X_", "=_", "np_", "._", "delete_", "(_", "X_", ",_", "hold", "\\u", "out_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "np_", "._", "delete_", "(_", "y_", ",_", "hold", "\\u", "out_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "estimator_", "._", "fit_", "(_", "X_", ",_", "y_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "hold", "\\u", "out", "\\u", "predictions_", "=_", "self_", "._", "estimator_", "._", "predi", "ct", "\\u", "proba_", "(_", "X", "\\u", "hold", "\\u", "out_", ")_", "\\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 ", " _", "hold", "\\u", "out", "\\u", "predictions_", "=_", "hold", "\\u", "out", "\\u", "predictions_", "[_", ":_", ",_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "=_", "np_", "._", "mean_", "(_", "hold", "\\u", "out", "\\u", "predictions_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "c_", "=_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "esti", "mat", "or", "\\u", "fitted", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "PU", "Adapter_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "predi", "ct", "\\u", "proba_", "(_", "self_", ",_", "X_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Predic", "ts", " ", "p", "(", "y", "=", "1", "|", "x", ")", " ", "usi", "ng", " ", "the", " ", "esti", "mat", "or", " ", "and", " ", "the", " ", "value", " ", "of", " ", "p", "(", "s", "=", "1", "|", "y", "=", "1", ")", " ", "estimate", "d", " ", "in", " ", "fit", "(...)", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "X", " ", "--", " ", "List", " ", "of", " ", "feature", " ", "vector", "s", " ", "or", " ", "a", " ", "precompute", "d", " ", "kernel", " ", "matrix", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "esti", "mat", "or", "\\u", "fitted", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "The", " ", "esti", "mat", "or", " ", "must", " ", "be", " ", "fitted", " ", "bef", "ore", " ", "calling", " ", "predi", "ct", "\\u", "proba", "(...)", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "probab", "ilis", "tic", "\\u", "predictions_", "=_", "self_", "._", "estimator_", "._", "predi", "ct", "\\u", "proba_", "(_", "X_", ")_", "\\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 ", " _", "probab", "ilis", "tic", "\\u", "predictions_", "=_", "probab", "ilis", "tic", "\\u", "predictions_", "[_", ":_", ",_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "probab", "ilis", "tic", "\\u", "predictions_", "/_", "self_", "._", "c_", "\\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, 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2, 2, 2, 2, 2, 2, 2 ]
Unused local variable
fp7-ofelia/ocf/ofam/src/src/foam/sfa/methods/GetGids.py
[ { "content": " def call(self, xrns, creds):\n # validate the credential\n valid_creds = self.api.auth.checkCredentials(creds, 'getgids')\n # xxxpylintxxx origin_hrn is unused..\n origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()\n \n # resolve the record\n records = self.api.manager.Resolve(self.api, xrns, details = False)\n if not records:\n raise RecordNotFound(xrns)\n\n allowed_fields = ['hrn', 'type', 'gid']\n for record in records:\n for key in record.keys():\n if key not in allowed_fields:\n del(record[key])\n return records ", "metadata": "root.GetGids.call", "header": "['class', 'GetGids', '(', 'Method', ')', ':', '___EOS___']", "index": 28 } ]
[ { "span": "origin_hrn ", "start_line": 32, "start_column": 8, "end_line": 32, "end_column": 18 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Get", "Gi", "ds_", "(_", "Method_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "call_", "(_", "self_", ",_", "xr", "ns_", ",_", "creds_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "validat", "e", " ", "the", " ", "credential_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "valid", "\\u", "creds_", "=_", "self_", "._", "api_", "._", "auth_", "._", "check", "Credentials_", "(_", "creds_", ",_", "'", "getg", "ids", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "xxx", "pylint", "xxx", " ", "orig", "in", "\\u", "hr", "n", " ", "is", " ", "unu", "sed", "..", "_", "\\u\\u\\uNL\\u\\u\\u_", "orig", "in", "\\u", "hr", "n_", "=_", "Cred", "ential_", "(_", "string_", "=_", "valid", "\\u", "creds_", "[_", "0_", "]_", ")_", "._", "get", "\\u", "gid", "\\u", "caller_", "(_", ")_", "._", "get", "\\u", "hr", "n_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "resolve", " ", "the", " ", "record_", "\\u\\u\\uNL\\u\\u\\u_", "records_", "=_", "self_", "._", "api_", "._", "manager_", "._", "Resolv", "e_", "(_", "self_", "._", "api_", ",_", "xr", "ns_", ",_", "details_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "records_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Record", "Not", "Found_", "(_", "xr", "ns_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "allow", "ed", "\\u", "fields_", "=_", "[_", "'", "hr", "n", "'_", ",_", "'", "type", "'_", ",_", "'", "gid", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "record_", "in_", "records_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "key_", "in_", "record_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "key_", "not_", "in_", "allow", "ed", "\\u", "fields_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "del_", "(_", "record_", "[_", "key_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "records_" ]
[ 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, 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 ]
Unused local variable
amueller/word_cloud/doc/sphinxext/numpy_ext/docscrape.py
[ { "content": " def __str__(self):\n out = ''\n\n func, func_name = self.get_func()\n signature = self['Signature'].replace('*', '\\*')\n\n roles = {'func': 'function',\n 'meth': 'method'}\n\n if self._role:\n if not roles.has_key(self._role):\n print \"Warning: invalid role %s\" % self._role\n out += '.. %s:: %s\\n \\n\\n' % (roles.get(self._role, ''),\n func_name)\n\n out += super(FunctionDoc, self).__str__(func_role=self._role)\n return out", "metadata": "root.FunctionDoc.__str__", "header": "['class', 'FunctionDoc', '(', 'NumpyDocString', ')', ':', '___EOS___']", "index": 449 } ]
[ { "span": "signature ", "start_line": 453, "start_column": 8, "end_line": 453, "end_column": 17 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Function", "Doc_", "(_", "Num", "py", "Doc", "String_", ")_", ":_", "\\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 ", " _", "out_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "func_", ",_", "func", "\\u", "name_", "=_", "self_", "._", "get", "\\u", "func_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signature_", "=_", "self_", "[_", "'", "Sign", "ature", "'_", "]_", "._", "replace_", "(_", "'*'_", ",_", "'\\\\", "*'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "roles_", "=_", "{_", "'", "func", "'_", ":_", "'", "function", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "meth", "'_", ":_", "'", "method", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "self_", "._", "\\u", "role_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "roles_", "._", "has", "\\u", "key_", "(_", "self_", "._", "\\u", "role_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Warn", "ing", ":", " ", "invalid", " ", "role", " ", "%", "s", "\"_", "%_", "self_", "._", "\\u", "role_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "out_", "+=_", "'..", " ", "%", "s", "::", " ", "%", "s", "\\\\", "n", " ", " ", " ", " ", "\\\\", "n", "\\\\", "n", "'_", "%_", "(_", "roles_", "._", "get_", "(_", "self_", "._", "\\u", "role_", ",_", "''_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "func", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "out_", "+=_", "super_", "(_", "Function", "Doc_", ",_", "self_", ")_", "._", "\\u\\u", "str\\u\\u_", "(_", "func", "\\u", "role_", "=_", "self_", "._", "\\u", "role_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "out_", "\\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, 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 ]
Unused import
mitsuhiko/multiversion/tests/versioned-libs/using_testlib_10.py
[ { "content": "import multiversion\nmultiversion.require_version('testlib', '1.0')\n\nfrom testlib import a_function\nimport testlib as mod\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "from testlib import a_function", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 30 }, { "span": "import testlib as mod", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 21 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "import_", "multiv", "ersion_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "multiv", "ersion_", "._", "require", "\\u", "version_", "(_", "'", "testl", "ib", "'_", ",_", "'", "1.0", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "testlib_", "import_", "a", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "testlib_", "as_", "mod_" ]
[ 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, 0, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1 ]
Unused local variable
osrg/ryu/ryu/ofproto/ofproto_v1_4_parser.py
[ { "content": " @classmethod\n def parser(cls, buf, offset):\n (type_, len_) = struct.unpack_from(\n ofproto.OFP_ACTION_HEADER_PACK_STR, buf, offset)\n return cls()", "metadata": "root.OFPActionDecMplsTtl.parser", "header": "['class', 'OFPActionDecMplsTtl', '(', 'OFPAction', ')', ':', '___EOS___']", "index": 4677 }, { "content": " @classmethod\n def parser(cls, buf, offset):\n (type_, len_) = struct.unpack_from(\n ofproto.OFP_ACTION_HEADER_PACK_STR, buf, offset)\n return cls()", "metadata": "root.OFPActionDecNwTtl.parser", "header": "['class', 'OFPActionDecNwTtl', '(', 'OFPAction', ')', ':', '___EOS___']", "index": 4724 }, { "content": " @classmethod\n def parser(cls, buf, offset):\n (type_, len_) = struct.unpack_from(\n ofproto.OFP_ACTION_HEADER_PACK_STR, buf, offset)\n return cls()", "metadata": "root.OFPActionCopyTtlOut.parser", "header": "['class', 'OFPActionCopyTtlOut', '(', 'OFPAction', ')', ':', '___EOS___']", "index": 4743 }, { "content": " @classmethod\n def parser(cls, buf, offset):\n (type_, len_) = struct.unpack_from(\n ofproto.OFP_ACTION_HEADER_PACK_STR, buf, offset)\n return cls()", "metadata": "root.OFPActionCopyTtlIn.parser", "header": "['class', 'OFPActionCopyTtlIn', '(', 'OFPAction', ')', ':', '___EOS___']", "index": 4762 }, { "content": " @classmethod\n def parser(cls, buf, offset):\n (type_, len_) = struct.unpack_from(\n ofproto.OFP_ACTION_HEADER_PACK_STR, buf, offset)\n return cls()", "metadata": "root.OFPActionPopVlan.parser", "header": "['class', 'OFPActionPopVlan', '(', 'OFPAction', ')', ':', '___EOS___']", "index": 4838 }, { "content": " @classmethod\n def parser(cls, buf, offset):\n (type_, len_) = struct.unpack_from(\n ofproto.OFP_ACTION_HEADER_PACK_STR, buf, offset)\n return cls()", "metadata": "root.OFPActionPopPbb.parser", "header": "['class', 'OFPActionPopPbb', '(', 'OFPAction', ')', ':', '___EOS___']", "index": 4969 } ]
[ { "span": "type_,", "start_line": 4679, "start_column": 9, "end_line": 4679, "end_column": 14 }, { "span": "len_)", "start_line": 4679, "start_column": 16, "end_line": 4679, "end_column": 20 }, { "span": "type_,", "start_line": 4726, "start_column": 9, "end_line": 4726, "end_column": 14 }, { "span": "len_)", "start_line": 4726, "start_column": 16, "end_line": 4726, "end_column": 20 }, { "span": "type_,", "start_line": 4745, "start_column": 9, "end_line": 4745, "end_column": 14 }, { "span": "len_)", "start_line": 4745, "start_column": 16, "end_line": 4745, "end_column": 20 }, { "span": "type_,", "start_line": 4764, "start_column": 9, "end_line": 4764, "end_column": 14 }, { "span": "len_)", "start_line": 4764, "start_column": 16, "end_line": 4764, "end_column": 20 }, { "span": "type_,", "start_line": 4840, "start_column": 9, "end_line": 4840, "end_column": 14 }, { "span": "len_)", "start_line": 4840, "start_column": 16, "end_line": 4840, "end_column": 20 }, { "span": "type_,", "start_line": 4971, "start_column": 9, "end_line": 4971, "end_column": 14 }, { "span": "len_)", "start_line": 4971, "start_column": 16, "end_line": 4971, "end_column": 20 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "OFP", "Action", "De", "c", "Mp", "ls", "Tt", "l_", "(_", "OFP", "Action_", ")_", ":_", "\\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_", "parser_", "(_", "cls_", ",_", "buf_", ",_", "offset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "type\\u_", ",_", "len", "\\u_", ")_", "=_", "struct_", "._", "unpack", "\\u", "from_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "ofproto_", "._", "OFP", "\\u", "ACTI", "ON", "\\u", "HEAD", "ER", "\\u", "PACK", "\\u", "STR_", ",_", "buf_", ",_", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cls_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OFP", "Action", "De", "c", "Nw", "Tt", "l_", "(_", "OFP", "Action_", ")_", ":_", "\\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_", "parser_", "(_", "cls_", ",_", "buf_", ",_", "offset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "type\\u_", ",_", "len", "\\u_", ")_", "=_", "struct_", "._", "unpack", "\\u", "from_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "ofproto_", "._", "OFP", "\\u", "ACTI", "ON", "\\u", "HEAD", "ER", "\\u", "PACK", "\\u", "STR_", ",_", "buf_", ",_", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cls_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OFP", "Action", "Copy", "Tt", "l", "Out_", "(_", "OFP", "Action_", ")_", ":_", "\\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_", "parser_", "(_", "cls_", ",_", "buf_", ",_", "offset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "type\\u_", ",_", "len", "\\u_", ")_", "=_", "struct_", "._", "unpack", "\\u", "from_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "ofproto_", "._", "OFP", "\\u", "ACTI", "ON", "\\u", "HEAD", "ER", "\\u", "PACK", "\\u", "STR_", ",_", "buf_", ",_", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cls_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OFP", "Action", "Copy", "Tt", "l", "In_", "(_", "OFP", "Action_", ")_", ":_", "\\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_", "parser_", "(_", "cls_", ",_", "buf_", ",_", "offset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "type\\u_", ",_", "len", "\\u_", ")_", "=_", "struct_", "._", "unpack", "\\u", "from_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "ofproto_", "._", "OFP", "\\u", "ACTI", "ON", "\\u", "HEAD", "ER", "\\u", "PACK", "\\u", "STR_", ",_", "buf_", ",_", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cls_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OFP", "Action", "Pop", "Vla", "n_", "(_", "OFP", "Action_", ")_", ":_", "\\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_", "parser_", "(_", "cls_", ",_", "buf_", ",_", "offset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "type\\u_", ",_", "len", "\\u_", ")_", "=_", "struct_", "._", "unpack", "\\u", "from_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "ofproto_", "._", "OFP", "\\u", "ACTI", "ON", "\\u", "HEAD", "ER", "\\u", "PACK", "\\u", "STR_", ",_", "buf_", ",_", "offset_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "cls_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "OFP", "Action", "Pop", "Pb", "b_", "(_", "OFP", "Action_", ")_", ":_", "\\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_", "parser_", "(_", "cls_", ",_", "buf_", ",_", "offset_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "type\\u_", ",_", "len", "\\u_", ")_", "=_", "struct_", "._", "unpack", "\\u", "from_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "ofproto_", "._", "OFP", "\\u", "ACTI", "ON", "\\u", "HEAD", "ER", "\\u", "PACK", "\\u", "STR_", ",_", "buf_", ",_", "offset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 2, 2, 2, 2, 2, 2, 0, 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, 0, 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 ]
Unused import
kylewm/redwind/redwind/imageproxy.py
[ { "content": "from redwind import util\nfrom flask import request, abort, send_file, url_for, make_response, \\\n Blueprint, escape, current_app\nfrom requests.exceptions import HTTPError\nimport datetime\nimport hashlib\nimport hmac\nimport json\nimport os\nimport shutil\nimport sys\nimport urllib.parse\n\nimageproxy = Blueprint('imageproxy', __name__)\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def construct_url(url, size=None, external=False):\n from redwind.models import get_settings\n if not url or 'PILBOX_URL' not in current_app.config:\n return url\n url = urllib.parse.urljoin(get_settings().site_url, url)\n query = [('url', url)]\n if size:\n query += [('w', size), ('h', size), ('mode', 'clip')]\n else:\n query += [('op', 'noop')]\n querystring = urllib.parse.urlencode(query)\n if 'PILBOX_KEY' in current_app.config:\n h = hmac.new(current_app.config['PILBOX_KEY'].encode(),\n querystring.encode(), hashlib.sha1)\n querystring += '&sig=' + h.hexdigest()\n proxy_url = current_app.config['PILBOX_URL'] + '?' + querystring\n if external:\n proxy_url = urllib.parse.urljoin(get_settings().site_url, proxy_url)\n return proxy_url", "metadata": "root.construct_url", "header": "['module', '___EOS___']", "index": 16 }, { "content": "@imageproxy.app_template_filter('imageproxy')\ndef imageproxy_filter(src, side=None, external=False):\n return escape(\n construct_url(src, side and str(side), external))", "metadata": "root.imageproxy_filter", "header": "['module', '___EOS___']", "index": 37 } ]
[ { "span": "from redwind import util", "start_line": 0, "start_column": 0, "end_line": 0, "end_column": 24 }, { "span": "from flask import request, abort, send_file, url_for, make_response, \\\n Blueprint, escape, current_app", "start_line": 1, "start_column": 0, "end_line": 2, "end_column": 34 }, { "span": "from requests.exceptions import HTTPError", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 41 }, { "span": "import datetime", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 15 }, { "span": "import json", "start_line": 7, "start_column": 0, "end_line": 7, "end_column": 11 }, { "span": "import os", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 9 }, { "span": "import shutil", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 13 }, { "span": "import sys", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "red", "wind_", "import_", "util_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "flask_", "import_", "request_", ",_", "abort_", ",_", "send", "\\u", "file_", ",_", "url", "\\u", "for_", ",_", "make", "\\u", "response_", ",_", "Blueprint_", ",_", "escape_", ",_", "current", "\\u", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "requests_", "._", "exceptions_", "import_", "HTTP", "Error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hashlib_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "hmac_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "json_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "shutil_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "urllib_", "._", "parse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "image", "proxy_", "=_", "Blueprint_", "(_", "'", "image", "proxy", "'_", ",_", "\\u\\u", "name\\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_", "construct", "\\u", "url_", "(_", "url_", ",_", "size_", "=_", "None_", ",_", "external_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "red", "wind_", "._", "models_", "import_", "get", "\\u", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "url_", "or_", "'", "PI", "LB", "OX", "\\u", "URL", "'_", "not_", "in_", "current", "\\u", "app_", "._", "config_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url_", "=_", "urllib_", "._", "parse_", "._", "urljoin_", "(_", "get", "\\u", "settings_", "(_", ")_", "._", "site", "\\u", "url_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "query_", "=_", "[_", "(_", "'", "url", "'_", ",_", "url_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "size_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "query_", "+=_", "[_", "(_", "'", "w", "'_", ",_", "size_", ")_", ",_", "(_", "'", "h", "'_", ",_", "size_", ")_", ",_", "(_", "'", "mode", "'_", ",_", "'", "clip", "'_", ")_", "]_", "\\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 ", " _", "query_", "+=_", "[_", "(_", "'", "op", "'_", ",_", "'", "noop", "'_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "querystring", "_", "=_", "urllib_", "._", "parse_", "._", "urlencode_", "(_", "query_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "'", "PI", "LB", "OX", "\\u", "KEY", "'_", "in_", "current", "\\u", "app_", "._", "config_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "=_", "hmac_", "._", "new_", "(_", "current", "\\u", "app_", "._", "config_", "[_", "'", "PI", "LB", "OX", "\\u", "KEY", "'_", "]_", "._", "encode_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "querystring", "_", "._", "encode_", "(_", ")_", ",_", "hashlib_", "._", "sha1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "querystring", "_", "+=_", "'&", "sig", "='_", "+_", "h_", "._", "hexdigest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "proxy", "\\u", "url_", "=_", "current", "\\u", "app_", "._", "config_", "[_", "'", "PI", "LB", "OX", "\\u", "URL", "'_", "]_", "+_", "'?'_", "+_", "querystring", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "external_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proxy", "\\u", "url_", "=_", "urllib_", "._", "parse_", "._", "urljoin_", "(_", "get", "\\u", "settings_", "(_", ")_", "._", "site", "\\u", "url_", ",_", "proxy", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "proxy", "\\u", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "@_", "image", "proxy_", "._", "app", "\\u", "template", "\\u", "filter_", "(_", "'", "image", "proxy", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "image", "proxy", "\\u", "filter_", "(_", "src_", ",_", "side_", "=_", "None_", ",_", "external_", "=_", "False_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "escape_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "construct", "\\u", "url_", "(_", "src_", ",_", "side_", "and_", "str_", "(_", "side_", ")_", ",_", "external_", ")_", ")_" ]
[ 4, 4, 4, 4, 4, 2, 2, 0, 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, 2, 0, 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 0, 1, 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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Unused local variable
ImageEngine/gaffer/python/GafferDispatchTest/TaskContextVariablesTest.py
[ { "content": "\tdef testDisabledVariable( self ) :\n\n\t\tscript = Gaffer.ScriptNode()\n\n\t\tscript[\"writer\"] = GafferDispatchTest.TextWriter()\n\t\tscript[\"writer\"][\"fileName\"].setValue( self.temporaryDirectory() + \"/${name1}${name2}.txt\" )\n\n\t\tscript[\"variables\"] = GafferDispatch.TaskContextVariables()\n\t\tscript[\"variables\"][\"preTasks\"][0].setInput( script[\"writer\"][\"task\"] )\n\t\tjim = script[\"variables\"][\"variables\"].addOptionalMember( \"name1\", \"jim\", enabled = False )\n\t\tbob = script[\"variables\"][\"variables\"].addOptionalMember( \"name2\", \"bob\", enabled = True )\n\n\t\tself.__dispatcher().dispatch( [ script[\"variables\"] ] )\n\n\t\tself.assertEqual(\n\t\t\tset( glob.glob( self.temporaryDirectory() + \"/*.txt\" ) ),\n\t\t\t{\n\t\t\t\tself.temporaryDirectory() + \"/bob.txt\",\n\n\t\t\t}\n\t\t)", "metadata": "root.TaskContextVariablesTest.testDisabledVariable", "header": "['class', 'TaskContextVariablesTest', '(', 'GafferTest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 74 } ]
[ { "span": "jim ", "start_line": 83, "start_column": 2, "end_line": 83, "end_column": 5 }, { "span": "bob ", "start_line": 84, "start_column": 2, "end_line": 84, "end_column": 5 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Task", "Context", "Varia", "bles", "Test_", "(_", "Ga", "ffer", "Test_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "Disa", "ble", "d", "Variable_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u\t", "\t_", "script_", "=_", "Ga", "ffer", "_", "._", "Script", "Node_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "script_", "[_", "\"", "writer", "\"_", "]_", "=_", "Ga", "ffer", "Dispa", "tch", "Test_", "._", "Text", "Writer_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "script_", "[_", "\"", "writer", "\"_", "]_", "[_", "\"", "file", "Name", "\"_", "]_", "._", "set", "Value_", "(_", "self_", "._", "temporar", "y", "Directory_", "(_", ")_", "+_", "\"/", "${", "name", "1", "}$", "{", "name2", "}.", "txt", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "script_", "[_", "\"", "variab", "les", "\"_", "]_", "=_", "Ga", "ffer", "Dispa", "tch_", "._", "Task", "Context", "Variables_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "script_", "[_", "\"", "variab", "les", "\"_", "]_", "[_", "\"", "pre", "Task", "s", "\"_", "]_", "[_", "0_", "]_", "._", "set", "Input_", "(_", "script_", "[_", "\"", "writer", "\"_", "]_", "[_", "\"", "task", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "jim", "_", "=_", "script_", "[_", "\"", "variab", "les", "\"_", "]_", "[_", "\"", "variab", "les", "\"_", "]_", "._", "add", "Optio", "nal", "Member_", "(_", "\"", "name", "1", "\"_", ",_", "\"", "jim", "\"_", ",_", "enabled_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bob_", "=_", "script_", "[_", "\"", "variab", "les", "\"_", "]_", "[_", "\"", "variab", "les", "\"_", "]_", "._", "add", "Optio", "nal", "Member_", "(_", "\"", "name2", "\"_", ",_", "\"", "bob", "\"_", ",_", "enabled_", "=_", "True_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "\\u\\u", "dispatcher_", "(_", ")_", "._", "dispatch_", "(_", "[_", "script_", "[_", "\"", "variab", "les", "\"_", "]_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "set_", "(_", "glob_", "._", "glob_", "(_", "self_", "._", "tem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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 ]
Unused import
codingforentrepreneurs/srvup-membership/src/videos/migrations/0014_auto_20150131_1915.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 ('videos', '0013_auto_20150130_2131'),\n ]\n\n operations = [\n migrations.AlterModelOptions(\n name='video',\n options={'ordering': ['order', '-timestamp']},\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_", "(_", "'", "videos", "'_", ",_", "'", "001", "3", "\\u", "auto", "\\u", "20150", "130", "\\u", "213", "1", "'_", ")_", ",_", "\\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_", "._", "Alter", "Model", "Options_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "name_", "=_", "'", "video", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "options_", "=_", "{_", "'", "orderi", "ng", "'_", ":_", "[_", "'", "order", "'_", ",_", "'-", "timestamp", "'_", "]_", "}_", ",_", "\\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 ]
Imprecise assert
amrdraz/kodr/app/brython/www/src/Lib/test/test_platform.py
[ { "content": " def test_mac_ver(self):\n res = platform.mac_ver()\n\n if platform.uname().system == 'Darwin':\n # We're on a MacOSX system, check that\n # the right version information is returned\n fd = os.popen('sw_vers', 'r')\n real_ver = None\n for ln in fd:\n if ln.startswith('ProductVersion:'):\n real_ver = ln.strip().split()[-1]\n break\n fd.close()\n self.assertFalse(real_ver is None)\n result_list = res[0].split('.')\n expect_list = real_ver.split('.')\n len_diff = len(result_list) - len(expect_list)\n # On Snow Leopard, sw_vers reports 10.6.0 as 10.6\n if len_diff > 0:\n expect_list.extend(['0'] * len_diff)\n self.assertEqual(result_list, expect_list)\n\n # res[1] claims to contain\n # (version, dev_stage, non_release_version)\n # That information is no longer available\n self.assertEqual(res[1], ('', '', ''))\n\n if sys.byteorder == 'little':\n self.assertIn(res[2], ('i386', 'x86_64'))\n else:\n self.assertEqual(res[2], 'PowerPC')", "metadata": "root.PlatformTest.test_mac_ver", "header": "['class', 'PlatformTest', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 184 } ]
[ { "span": "self.assertFalse(real_ver is None)", "start_line": 197, "start_column": 12, "end_line": 197, "end_column": 46 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Plat", "form", "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", "mac", "\\u", "ver_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "res_", "=_", "platform_", "._", "mac", "\\u", "ver_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "platform_", "._", "uname_", "(_", ")_", "._", "system_", "==_", "'", "Dar", "win", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "We", "'", "re", " ", "on", " ", "a", " ", "Mac", "OSX", " ", "system", ",", " ", "check", " ", "that_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "right", " ", "version", " ", "informati", "on", " ", "is", " ", "returned_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fd_", "=_", "os_", "._", "popen_", "(_", "'", "sw", "\\u", "vers", "'_", ",_", "'", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "real", "\\u", "ver_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ln_", "in_", "fd_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "ln_", "._", "startswith_", "(_", "'", "Product", "Version", ":'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "real", "\\u", "ver_", "=_", "ln_", "._", "strip_", "(_", ")_", "._", "split_", "(_", ")_", "[_", "-_", "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_", "fd_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "real", "\\u", "ver_", "is_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "result", "\\u", "list_", "=_", "res_", "[_", "0_", "]_", "._", "split_", "(_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "expect", "\\u", "list_", "=_", "real", "\\u", "ver_", "._", "split_", "(_", "'.'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "len", "\\u", "diff_", "=_", "len_", "(_", "result", "\\u", "list_", ")_", "-_", "len_", "(_", "expect", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "On", " ", "Snow", " ", "Leo", "par", "d", ",", " ", "sw", "\\u", "vers", " ", "report", "s", " ", "10.", "6.0", " ", "as", " ", "10.", "6_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "len", "\\u", "diff_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "expect", "\\u", "list_", "._", "extend_", "(_", "[_", "'", "0", "'_", "]_", "*_", "len", "\\u", "diff_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "result", "\\u", "list_", ",_", "expect", "\\u", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "res", "[", "1", "]", " ", "claim", "s", " ", "to", " ", "contain", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "version", ",", " ", "dev", "\\u", "stage", ",", " ", "non", "\\u", "release", "\\u", "version", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tha", "t", " ", "informati", "on", " ", "is", " ", "no", " ", "long", "er", " ", "available_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "res_", "[_", "1_", "]_", ",_", "(_", "''_", ",_", "''_", ",_", "''_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sys_", "._", "byteorder_", "==_", "'", "litt", "le", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "In_", "(_", "res_", "[_", "2_", "]_", ",_", "(_", "'", "i3", "86", "'_", ",_", "'", "x8", "6", "\\u", "64", "'_", ")_", ")_", "\\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_", "(_", "res_", "[_", "2_", "]_", ",_", "'", "Power", "PC", "'_", ")_", "\\u\\u\\uNEWLINE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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 ]
Unreachable code
statsmodels/statsmodels/statsmodels/tsa/statespace/tests/test_dynamic_factor.py
[ { "content": " def test_no_enforce(self):\n return\n # Test that nothing goes wrong when we don't enforce stationarity\n params = self.model.untransform_params(self.true['params'])\n params[self.model._params_transition] = (\n self.true['params'][self.model._params_transition])\n self.model.enforce_stationarity = False\n results = self.model.filter(params, transformed=False)\n self.model.enforce_stationarity = True\n assert_allclose(results.llf, self.results.llf, rtol=1e-5)", "metadata": "root.CheckDynamicFactor.test_no_enforce", "header": "['class', 'CheckDynamicFactor', '(', 'object', ')', ':', '___EOS___']", "index": 94 } ]
[ { "span": "params = self.model.untransform_params(self.true['params'])", "start_line": 97, "start_column": 8, "end_line": 97, "end_column": 67 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "class_", "Check", "Dynamic", "Factor_", "(_", "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", "enforce", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Test", " ", "tha", "t", " ", "not", "hing", " ", "go", "es", " ", "wrong", " ", "whe", "n", " ", "we", " ", "don", "'", "t", " ", "enforce", " ", "station", "arity_", "\\u\\u\\uNL\\u\\u\\u_", "params_", "=_", "self_", "._", "model_", "._", "untr", "ans", "form", "\\u", "params_", "(_", "self_", "._", "true_", "[_", "'", "params", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "params_", "[_", "self_", "._", "model_", "._", "\\u", "params", "\\u", "transition_", "]_", "=_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "true_", "[_", "'", "params", "'_", "]_", "[_", "self_", "._", "model_", "._", "\\u", "params", "\\u", "transition_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model_", "._", "enforce", "\\u", "station", "arity_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "self_", "._", "model_", "._", "filter_", "(_", "params_", ",_", "transformed_", "=_", "False_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "model_", "._", "enforce", "\\u", "station", "arity_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "allclose_", "(_", "results_", "._", "ll", "f_", ",_", "self_", "._", "results_", "._", "ll", "f_", ",_", "rtol_", "=_", "1e-5_", ")_", "\\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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
briandilley/ebs-deploy/ebs_deploy/commands/rebuild_command.py
[ { "content": "def execute(helper, config, args):\n \"\"\"\n Rebuilds an environment\n \"\"\"\n env_config = parse_env_config(config, args.environment)\n helper.rebuild_environment(args.environment)\n\n # wait\n if not args.dont_wait:\n helper.wait_for_environments(args.environment, health='Green', status='Ready')", "metadata": "root.execute", "header": "['module', '___EOS___']", "index": 10 } ]
[ { "span": "env_config ", "start_line": 14, "start_column": 4, "end_line": 14, "end_column": 14 } ]
[]
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_", "execute_", "(_", "helper_", ",_", "config_", ",_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Reb", "uild", "s", " ", "an", " ", "environ", "ment", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "env", "\\u", "config_", "=_", "parse", "\\u", "env", "\\u", "config_", "(_", "config_", ",_", "args_", "._", "environment_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "helper_", "._", "rebu", "ild", "\\u", "environment_", "(_", "args_", "._", "environment_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "wait_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "args_", "._", "don", "t", "\\u", "wait_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "helper_", "._", "wait", "\\u", "for", "\\u", "environments_", "(_", "args_", "._", "environment_", ",_", "health_", "=_", "'", "Green", "'_", ",_", "status_", "=_", "'", "Read", "y", "'_", ")_" ]
[ 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, 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 ]
Unused import
selfsk/nodeset.core/src/nodeset/common/log.py
[ { "content": "from twisted.python import log, logfile, util\n\nimport logging\n\nlogLevel = {logging.DEBUG: 'DEBUG',\n logging.ERROR: 'ERROR',\n logging.INFO: 'INFO',\n logging.WARN: 'WARN',\n logging.CRITICAL: 'CRITICAL'}\n\nimport sys\n\n\n \n\n \n \n \n\ncrit = err\nwarn = err\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class NodeSetLog(logfile.DailyLogFile):\n \"\"\" Special class for log rotation, always return True on shouldRotate(),\n on SIGUSR1, handler checks shouldRotate() value\n \"\"\"\n ", "metadata": "root.NodeSetLog", "header": "['module', '___EOS___']", "index": 12 }, { "content": " def __init__(self, *args, **kwargs):\n logfile.DailyLogFile.__init__(self, *args, **kwargs)", "metadata": "root.NodeSetLog.__init__", "header": "['class', 'NodeSetLog', '(', 'logfile', '.', 'DailyLogFile', ')', ':', '___EOS___']", "index": 16 }, { "content": " def shouldRotate(self):\n return True", "metadata": "root.NodeSetLog.shouldRotate", "header": "['class', 'NodeSetLog', '(', 'logfile', '.', 'DailyLogFile', ')', ':', '___EOS___']", "index": 19 }, { "content": "class NodeSetLogObserver(log.FileLogObserver):\n \n ", "metadata": "root.NodeSetLogObserver", "header": "['module', '___EOS___']", "index": 23 }, { "content": " def __init__(self, f, level):\n log.FileLogObserver.__init__(self, f)\n\n self.level = level", "metadata": "root.NodeSetLogObserver.__init__", "header": "['class', 'NodeSetLogObserver', '(', 'log', '.', 'FileLogObserver', ')', ':', '___EOS___']", "index": 25 }, { "content": " def emit(self, eventDict):\n text = log.textFromEventDict(eventDict)\n \n if text is None:\n return\n \n if not eventDict.has_key('logLevel'):\n eventDict['logLevel'] = 'INFO'\n elif logLevel.has_key(eventDict['logLevel']):\n if eventDict['logLevel'] < self.level:\n return\n \n eventDict['logLevel'] = logLevel[eventDict['logLevel']]\n \n timeStr = self.formatTime(eventDict['time'])\n fmtDict = {'system': eventDict['system'], 'text': text.replace(\"\\n\", \"\\n\\t\"),\n 'logLevel': eventDict['logLevel']}\n msgStr = log._safeFormat(\"[%(logLevel)s] [%(system)s] %(text)s\\n\", fmtDict)\n\n util.untilConcludes(self.write, timeStr + \" \" + msgStr)\n util.untilConcludes(self.flush) # Hoorj!", "metadata": "root.NodeSetLogObserver.emit", "header": "['class', 'NodeSetLogObserver', '(', 'log', '.', 'FileLogObserver', ')', ':', '___EOS___']", "index": 30 }, { "content": "class NodeSetLogStdout(NodeSetLogObserver):\n ", "metadata": "root.NodeSetLogStdout", "header": "['module', '___EOS___']", "index": 52 }, { "content": " def emit(self, eventDict):\n text = log.textFromEventDict(eventDict)\n \n lvl = eventDict.get('logLevel')\n \n if lvl:\n if lvl < self.level:\n return\n else:\n eventDict['logLevel'] = logLevel[eventDict['logLevel']]\n else:\n eventDict['logLevel'] = 'INFO'\n\n timeStr = self.formatTime(eventDict['time'])\n \n if eventDict['system'] == '-':\n eventDict['text'] = text\n \n self.write(timeStr + \" %(logLevel)s %(text)s\\n\" % eventDict)\n self.flush()", "metadata": "root.NodeSetLogStdout.emit", "header": "['class', 'NodeSetLogStdout', '(', 'NodeSetLogObserver', ')', ':', '___EOS___']", "index": 54 }, { "content": "def _get_instance():\n try:\n import sys\n f = sys._getframe(2)\n \n r = f.f_locals['self']\n c = f.f_code.co_name\n #l = f.f_code.co_firstlineno\n return \"%s.%s\" % (r.__class__.__name__, c)\n #return '%s@%s' % (r.__class__.__name__, hex(id(r)))\n except KeyError, e:\n return '-'", "metadata": "root._get_instance", "header": "['module', '___EOS___']", "index": 75 }, { "content": "def msg(message, *args, **kwargs):\n \n instance = _get_instance()\n \n log.callWithContext({'system': instance}, log.msg, message, *args, \n **kwargs)", "metadata": "root.msg", "header": "['module', '___EOS___']", "index": 88 }, { "content": "def err(_stuff=None, _why=None, loglevel=logging.ERROR, **kw):\n instance = _get_instance()\n \n log.err(_stuff, _why, system=instance, logLevel=loglevel, **kw)", "metadata": "root.err", "header": "['module', '___EOS___']", "index": 95 } ]
[ { "span": "import sys", "start_line": 10, "start_column": 0, "end_line": 10, "end_column": 10 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "twisted_", "._", "python_", "import_", "log_", ",_", "logfile_", ",_", "util_", "\\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_", "log", "Level_", "=_", "{_", "logging_", "._", "DEBUG_", ":_", "'", "DEBU", "G", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "ERROR_", ":_", "'", "ERROR", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "INFO_", ":_", "'", "INFO", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "WARN_", ":_", "'", "WARN", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "logging_", "._", "CRITICAL_", ":_", "'", "CRIT", "ICAL", "'_", "}_", "\\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\\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_", "crit_", "=_", "err_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "warn_", "=_", "err_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "class_", "Node", "Set", "Log_", "(_", "logfile_", "._", "Da", "il", "y", "Log", "File_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Special", " ", "class", " ", "for", " ", "log", " ", "rotati", "on", ",", " ", "alw", "ay", "s", " ", "return", " ", "Tru", "e", " ", "on", " ", "shou", "ld", "Rotate", "()", ",", "\\", "10", ";", " ", " ", " ", " ", "on", " ", "SIG", "USR", "1", ",", " ", "handler", " ", "checks", " ", "shou", "ld", "Rotate", "()", " ", "value", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Node", "Set", "Log_", "(_", "logfile_", "._", "Da", "il", "y", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logfile_", "._", "Da", "il", "y", "Log", "File_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "Set", "Log_", "(_", "logfile_", "._", "Da", "il", "y", "Log", "File_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "shou", "ld", "Rotate", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Node", "Set", "Log", "Observer_", "(_", "log_", "._", "File", "Log", "Observer_", ")_", ":_", "\\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_", "Node", "Set", "Log", "Observer_", "(_", "log_", "._", "File", "Log", "Observer_", ")_", ":_", "\\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_", ",_", "f_", ",_", "level_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "log_", "._", "File", "Log", "Observer_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ",_", "f_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "level_", "=_", "level_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Node", "Set", "Log", "Observer_", "(_", "log_", "._", "File", "Log", "Observer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "emit_", "(_", "self_", ",_", "event", "Dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "log_", "._", "text", "Fro", "m", "Event", "Dict_", "(_", "event", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "text_", "is_", "None_", ":_", "\\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_", "if_", "not_", "event", "Dict_", "._", "has", "\\u", "key_", "(_", "'", "log", "Leve", "l", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "event", "Dict_", "[_", "'", "log", "Leve", "l", "'_", "]_", "=_", "'", "INFO", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "log", "Level_", "._", "has", "\\u", "key_", "(_", "event", "Dict_", "[_", "'", "log", "Leve", "l", "'_", "]_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "event", "Dict_", "[_", "'", "log", "Leve", "l", "'_", "]_", "<_", "self_", "._", "level_", ":_", "\\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_", "event", "Dict_", "[_", "'", "log", "Leve", "l", "'_", "]_", "=_", "log", "Level_", "[_", "event", "Dict_", "[_", "'", "log", "Leve", "l", "'_", "]_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time", "Str_", "=_", "self_", "._", "format", "Time_", "(_", "event", "Dict_", "[_", "'", "time", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fmt", "Dict_", "=_", "{_", "'", "system", "'_", ":_", "event", "Dict_", "[_", "'", "system", "'_", "]_", ",_", "'", "text", "'_", ":_", "text_", "._", "replace_", "(_", "\"\\\\", "n", "\"_", ",_", "\"\\\\", "n", "\\\\", "t", "\"_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "log", "Leve", "l", "'_", ":_", "event", "Dict_", "[_", "'", "log", "Leve", "l", "'_", "]_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "Str_", "=_", "log_", "._", "\\u", "safe", "Format_", "(_", "\"[", "%", "(", "log", "Leve", "l", ")", "s", "]", " ", "[", "%", "(", "system", ")", "s", "]", " ", "%", "(", "text", ")", "s", "\\\\", "n", "\"_", ",_", "fmt", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "util_", "._", "unti", "l", "Conc", "lud", "es_", "(_", "self_", "._", "write_", ",_", "time", "Str_", "+_", "\"", " ", "\"_", "+_", "msg", "Str_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "util_", "._", "unti", "l", "Conc", "lud", "es_", "(_", "self_", "._", "flush_", ")_", "#", " ", "Ho", "or", "j", "!", "_", "\\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_", "Node", "Set", "Log", "Stdout", "_", "(_", "Node", "Set", "Log", "Observer_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Node", "Set", "Log", "Stdout", "_", "(_", "Node", "Set", "Log", "Observer_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "emit_", "(_", "self_", ",_", "event", "Dict_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "log_", "._", "text", "Fro", "m", "Event", "Dict_", "(_", "event", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lvl_", "=_", "event", "Dict_", "._", "get_", "(_", "'", "log", "Leve", "l", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "lvl_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "lvl_", "<_", "self_", "._", "level_", ":_", "\\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 ", " _", "event", "Dict_", "[_", "'", "log", "Leve", "l", "'_", "]_", "=_", "log", "Level_", "[_", "event", "Dict_", "[_", "'", "log", "Leve", "l", "'_", "]_", "]_", "\\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 ", " _", "event", "Dict_", "[_", "'", "log", "Leve", "l", "'_", "]_", "=_", "'", "INFO", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "time", "Str_", "=_", "self_", "._", "format", "Time_", "(_", "event", "Dict_", "[_", "'", "time", "'_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "event", "Dict_", "[_", "'", "system", "'_", "]_", "==_", "'-'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "event", "Dict_", "[_", "'", "text", "'_", "]_", "=_", "text_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "write_", "(_", "time", "Str_", "+_", "\"", " ", "%", "(", "log", "Leve", "l", ")", "s", " ", "%", "(", "text", ")", "s", "\\\\", "n", "\"_", "%_", "event", "Dict_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "flush_", "(_", ")_", "\\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_", "\\u", "get", "\\u", "instance_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "f_", "=_", "sys_", "._", "\\u", "getframe_", "(_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "r_", "=_", "f_", "._", "f", "\\u", "locals_", "[_", "'", "self", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "=_", "f_", "._", "f", "\\u", "code_", "._", "co", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "l", " ", "=", " ", "f", ".", "f", "\\u", "code", ".", "co", "\\u", "firstl", "inen", "o_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "\"%", "s", ".", "%", "s", "\"_", "%_", "(_", "r_", "._", "\\u\\u", "class\\u\\u_", "._", "\\u\\u", "name\\u\\u_", ",_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "return", " ", "'%", "s", "@", "%", "s", "'", " ", "%", " ", "(", "r", ".\\u", "\\u", "class", "\\u\\u", ".\\u", "\\u", "name", "\\u\\u", ",", " ", "hex", "(", "id", "(", "r", ")))", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Key", "Error_", ",_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "'-'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "msg_", "(_", "message_", ",_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "instance_", "=_", "\\u", "get", "\\u", "instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "call", "With", "Context_", "(_", "{_", "'", "system", "'_", ":_", "instance_", "}_", ",_", "log_", "._", "msg_", ",_", "message_", ",_", "*_", "args_", ",_", "\\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_", "def_", "err_", "(_", "\\u", "stuff_", "=_", "None_", ",_", "\\u", "why_", "=_", "None_", ",_", "loglevel_", "=_", "logging_", "._", "ERROR_", ",_", "**_", "kw_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "instance_", "=_", "\\u", "get", "\\u", "instance_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "log_", "._", "err_", "(_", "\\u", "stuff_", ",_", "\\u", "why_", ",_", "system_", "=_", "instance_", ",_", "log", "Level_", "=_", "loglevel_", ",_", "**_", "kw_", ")_", "\\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,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 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 ]
Unused local variable
mogui/pyorient/tests/test_Factory_and_usage.py
[ { "content": " def test_hi_level_transaction(self):\n\n factory = pyorient.OrientDB('localhost', 2424)\n\n factory.get_message( pyorient.CONNECT ).prepare( (\"root\", \"root\") )\\\n .send().fetch_response()\n\n db_name = 'test_transactions'\n\n exists = factory.get_message( pyorient.DB_EXIST )\\\n .prepare( [db_name, pyorient.STORAGE_TYPE_MEMORY] )\\\n .send().fetch_response()\n\n print(\"Before %r\" % exists)\n try:\n ( factory.get_message( pyorient.DB_DROP ) ).prepare([db_name]) \\\n .send().fetch_response()\n assert True\n except pyorient.PyOrientCommandException as e:\n print(str(e))\n finally:\n ( factory.get_message( pyorient.DB_CREATE ) ).prepare(\n (db_name, pyorient.DB_TYPE_GRAPH, pyorient.STORAGE_TYPE_MEMORY)\n ).send().fetch_response()\n\n msg = factory.get_message( pyorient.DB_OPEN )\n cluster_info = msg.prepare(\n (db_name, \"admin\", \"admin\", pyorient.DB_TYPE_GRAPH, \"\")\n ).send().fetch_response()\n\n #######################################\n\n # execute real create\n rec = { 'alloggio': 'baita', 'lavoro': 'no', 'vacanza': 'lago' }\n rec_position = ( factory.get_message(pyorient.RECORD_CREATE) )\\\n .prepare( ( 3, rec ) )\\\n .send().fetch_response()\n\n # prepare for an update\n rec3 = { 'alloggio': 'albergo', 'lavoro': 'ufficio', 'vacanza': 'montagna' }\n update_success = ( factory.get_message(pyorient.RECORD_UPDATE) )\\\n .prepare( ( 3, rec_position._rid, rec3, rec_position._version ) )\n\n # prepare transaction\n rec1 = { 'alloggio': 'casa', 'lavoro': 'ufficio', 'vacanza': 'mare' }\n rec_position1 = ( factory.get_message(pyorient.RECORD_CREATE) )\\\n .prepare( ( -1, rec1 ) )\n\n rec2 = { 'alloggio': 'baita', 'lavoro': 'no', 'vacanza': 'lago' }\n rec_position2 = ( factory.get_message(pyorient.RECORD_CREATE) )\\\n .prepare( ( -1, rec2 ) )\n\n\n # create another real record\n rec = { 'alloggio': 'baita', 'lavoro': 'no', 'vacanza': 'lago' }\n rec_position = ( factory.get_message(pyorient.RECORD_CREATE) )\\\n .prepare( ( 3, rec ) )\\\n .send().fetch_response()\n\n delete_msg = ( factory.get_message(pyorient.RECORD_DELETE) )\n delete_msg.prepare( ( 3, rec_position._rid ) )\n\n\n tx = ( factory.get_message(pyorient.TX_COMMIT) )\n tx.begin()\n tx.attach( rec_position1 )\n tx.attach( rec_position1 )\n tx.attach( rec_position2 )\n tx.attach( update_success )\n tx.attach( delete_msg )\n res = tx.commit()\n\n for k, v in res.items():\n print(k + \" -> \" + v.vacanza)\n\n assert len(res) == 4\n assert res[\"#3:0\"].vacanza == 'montagna'\n assert res[\"#3:2\"].vacanza == 'mare'\n assert res[\"#3:3\"].vacanza == 'mare'\n assert res[\"#3:4\"].vacanza == 'lago'\n\n sid = ( factory.get_message(pyorient.CONNECT) ).prepare( (\"root\", \"root\") )\\\n .send().fetch_response()\n\n ( factory.get_message(pyorient.DB_DROP) ).prepare(\n [db_name, pyorient.STORAGE_TYPE_MEMORY ]) \\\n .send().fetch_response()", "metadata": "root.CommandTestCase.test_hi_level_transaction", "header": "['class', 'CommandTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 97 }, { "content": " def test_command(self):\n\n connection = pyorient.OrientSocket( \"localhost\", 2424 )\n\n factory = pyorient.OrientDB(connection)\n\n session_id = ( factory.get_message(pyorient.CONNECT) ).prepare( (\"root\", \"root\") )\\\n .send().fetch_response()\n\n db_name = \"tmp_test1\"\n\n try:\n # at the end drop the test database\n ( factory.get_message(pyorient.DB_DROP) ).prepare([db_name, pyorient.STORAGE_TYPE_MEMORY]) \\\n .send().fetch_response()\n\n except pyorient.PyOrientCommandException as e:\n print(str(e))\n finally:\n ( factory.get_message(pyorient.DB_CREATE) ).prepare(\n (db_name, pyorient.DB_TYPE_GRAPH, pyorient.STORAGE_TYPE_MEMORY)\n ).send().fetch_response()\n\n # open as serialize2binary\n msg = factory.get_message(pyorient.DB_OPEN)\n cluster_info = msg.prepare(\n (db_name, \"admin\", \"admin\", pyorient.DB_TYPE_DOCUMENT, \"\", pyorient.OrientSerialization.CSV)\n ).send().fetch_response()\n\n # ##################\n\n create_class = factory.get_message(pyorient.COMMAND)\n ins_msg1 = factory.get_message(pyorient.COMMAND)\n ins_msg2 = factory.get_message(pyorient.COMMAND)\n ins_msg3 = factory.get_message(pyorient.COMMAND)\n ins_msg4 = factory.get_message(pyorient.COMMAND)\n upd_msg5 = factory.get_message(pyorient.RECORD_UPDATE)\n\n req_msg = factory.get_message(pyorient.COMMAND)\n\n create_class.prepare( ( pyorient.QUERY_CMD, \"create class c_test extends V\" ) )\n ins_msg1.prepare( ( pyorient.QUERY_CMD, \"insert into c_test ( Band, Song ) values( 'AC/DC', 'Hells Bells' )\") )\n ins_msg2.prepare( ( pyorient.QUERY_CMD, \"insert into c_test ( Band, Song ) values( 'AC/DC', 'Who Made Who' )\") )\n ins_msg3.prepare( ( pyorient.QUERY_CMD, \"insert into c_test ( Band, Song ) values( 'AC/DC', 'T.N.T.' )\") )\n ins_msg4.prepare( ( pyorient.QUERY_CMD, \"insert into c_test ( Band, Song ) values( 'AC/DC', 'High Voltage' )\") )\n\n\n cluster = create_class.send().fetch_response()\n rec1 = ins_msg1.send().fetch_response()\n rec2 = ins_msg2.send().fetch_response()\n rec3 = ins_msg3.send().fetch_response()\n rec4 = ins_msg4.send().fetch_response()\n\n rec1 = rec1[0]\n upd_res = upd_msg5.prepare( ( rec1._rid, rec1._rid, { 'Band': 'Metallica', 'Song': 'One' } ) )\\\n .send().fetch_response()\n\n res = req_msg.prepare( [ pyorient.QUERY_SYNC, \"select from c_test\" ] ).send().fetch_response()\n\n assert isinstance(cluster, list)\n assert rec1._rid == res[0]._rid\n assert rec1._version != res[0]._version\n assert res[0]._version == upd_res[0]._version\n\n assert len(res) == 4\n assert res[0]._rid == '#11:0'\n assert res[0].Band == 'Metallica'\n assert res[0].Song == 'One'\n\n assert res[3].Song == 'High Voltage'\n\n # for x in res:\n # print(\"############\"\n # print(\"%r\" % x._rid\n # print(\"%r\" % x._class\n # print(\"%r\" % x._version\n # print(\"%r\" % x.Band\n # print(\"%r\" % x.Song\n\n\n # classes are allowed in record create/update/load\n rec = { '@c_test': { 'alloggio': 'casa', 'lavoro': 'ufficio', 'vacanza': 'mare' } }\n rec_position = ( factory.get_message(pyorient.RECORD_CREATE) )\\\n .prepare( ( cluster[0], rec ) )\\\n .send().fetch_response()\n\n print(\"New Rec Position: %s\" % rec_position._rid)\n assert rec_position._rid is not None\n\n rec = { '@c_test': { 'alloggio': 'albergo', 'lavoro': 'ufficio', 'vacanza': 'montagna' } }\n update_success = ( factory.get_message(pyorient.RECORD_UPDATE) )\\\n .prepare( ( rec_position._rid, rec_position._rid, rec ) )\\\n .send().fetch_response()\n\n\n req_msg = factory.get_message(pyorient.RECORD_LOAD)\n res = req_msg.prepare( [ rec_position._rid, \"*:-1\" ] ) \\\n .send().fetch_response()\n\n # print(res)\n # print(res._rid)\n # print(res._class)\n # print(res._version)\n # print(res.alloggio)\n # print(res.lavoro)\n # print(res.vacanza)\n\n assert res._rid == \"#11:4\"\n assert res._class == \"c_test\"\n assert res.alloggio == 'albergo'\n assert not hasattr( res, 'Band')\n assert not hasattr( res, 'Song')\n\n # print(\"\"\n # # at the end drop the test database\n # ( DbDropMessage( connection ) ).prepare([db_name, STORAGE_TYPE_MEMORY]) \\\n # .send().fetch_response()", "metadata": "root.CommandTestCase.test_command", "header": "['class', 'CommandTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 185 } ]
[ { "span": "cluster_info ", "start_line": 123, "start_column": 8, "end_line": 123, "end_column": 20 }, { "span": "sid ", "start_line": 178, "start_column": 8, "end_line": 178, "end_column": 11 }, { "span": "session_id ", "start_line": 191, "start_column": 8, "end_line": 191, "end_column": 18 }, { "span": "cluster_info ", "start_line": 210, "start_column": 8, "end_line": 210, "end_column": 20 }, { "span": "rec2 ", "start_line": 234, "start_column": 8, "end_line": 234, "end_column": 12 }, { "span": "rec3 ", "start_line": 235, "start_column": 8, "end_line": 235, "end_column": 12 }, { "span": "rec4 ", "start_line": 236, "start_column": 8, "end_line": 236, "end_column": 12 }, { "span": "update_success ", "start_line": 275, "start_column": 8, "end_line": 275, "end_column": 22 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "Command", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "hi", "\\u", "level", "\\u", "transaction_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "factory_", "=_", "pyo", "rien", "t_", "._", "Orient", "DB_", "(_", "'", "local", "host", "'_", ",_", "242", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "CONNECT", "_", ")_", "._", "prepare_", "(_", "(_", "\"", "root", "\"_", ",_", "\"", "root", "\"_", ")_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "name_", "=_", "'", "test\\u", "transaction", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "exists_", "=_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "DB", "\\u", "EXIST", "_", ")_", "._", "prepare_", "(_", "[_", "db", "\\u", "name_", ",_", "pyo", "rien", "t_", "._", "STOR", "AGE", "\\u", "TYPE", "\\u", "MEM", "ORY", "_", "]_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "Be", "fore", " ", "%", "r", "\"_", "%_", "exists_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "DB", "\\u", "DROP", "_", ")_", ")_", "._", "prepare_", "(_", "[_", "db", "\\u", "name_", "]_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "pyo", "rien", "t_", "._", "Py", "Orient", "Command", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "str_", "(_", "e_", ")_", ")_", "\\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 ", " _", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "DB", "\\u", "CREATE_", ")_", ")_", "._", "prepare_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "db", "\\u", "name_", ",_", "pyo", "rien", "t_", "._", "DB", "\\u", "TYPE", "\\u", "GRAPH", "_", ",_", "pyo", "rien", "t_", "._", "STOR", "AGE", "\\u", "TYPE", "\\u", "MEM", "ORY", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "DB", "\\u", "OPEN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cluster", "\\u", "info_", "=_", "msg_", "._", "prepare_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "db", "\\u", "name_", ",_", "\"", "admin", "\"_", ",_", "\"", "admin", "\"_", ",_", "pyo", "rien", "t_", "._", "DB", "\\u", "TYPE", "\\u", "GRAPH", "_", ",_", "\"\"_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###########", "###########", "###########", "######", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "execute", " ", "real", " ", "create_", "\\u\\u\\uNL\\u\\u\\u_", "rec_", "=_", "{_", "'", "allo", "ggi", "o", "'_", ":_", "'", "bai", "ta", "'_", ",_", "'", "lav", "oro", "'_", ":_", "'", "no", "'_", ",_", "'", "vaca", "nz", "a", "'_", ":_", "'", "lag", "o", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "\\u", "position_", "=_", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "RECORD", "\\u", "CREATE_", ")_", ")_", "._", "prepare_", "(_", "(_", "3_", ",_", "rec_", ")_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prepar", "e", " ", "for", " ", "an", " ", "update_", "\\u\\u\\uNL\\u\\u\\u_", "rec", "3_", "=_", "{_", "'", "allo", "ggi", "o", "'_", ":_", "'", "albe", "rg", "o", "'_", ",_", "'", "lav", "oro", "'_", ":_", "'", "uff", "icio", "'_", ",_", "'", "vaca", "nz", "a", "'_", ":_", "'", "mont", "agn", "a", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "\\u", "success_", "=_", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "RECORD", "\\u", "UPDATE_", ")_", ")_", "._", "prepare_", "(_", "(_", "3_", ",_", "rec", "\\u", "position_", "._", "\\u", "rid_", ",_", "rec", "3_", ",_", "rec", "\\u", "position_", "._", "\\u", "version_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "prepar", "e", " ", "transaction_", "\\u\\u\\uNL\\u\\u\\u_", "rec", "1_", "=_", "{_", "'", "allo", "ggi", "o", "'_", ":_", "'", "casa", "'_", ",_", "'", "lav", "oro", "'_", ":_", "'", "uff", "icio", "'_", ",_", "'", "vaca", "nz", "a", "'_", ":_", "'", "mar", "e", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "\\u", "position", "1_", "=_", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "RECORD", "\\u", "CREATE_", ")_", ")_", "._", "prepare_", "(_", "(_", "-_", "1_", ",_", "rec", "1_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rec", "2_", "=_", "{_", "'", "allo", "ggi", "o", "'_", ":_", "'", "bai", "ta", "'_", ",_", "'", "lav", "oro", "'_", ":_", "'", "no", "'_", ",_", "'", "vaca", "nz", "a", "'_", ":_", "'", "lag", "o", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "\\u", "position", "2_", "=_", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "RECORD", "\\u", "CREATE_", ")_", ")_", "._", "prepare_", "(_", "(_", "-_", "1_", ",_", "rec", "2_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "anot", "her", " ", "real", " ", "record_", "\\u\\u\\uNL\\u\\u\\u_", "rec_", "=_", "{_", "'", "allo", "ggi", "o", "'_", ":_", "'", "bai", "ta", "'_", ",_", "'", "lav", "oro", "'_", ":_", "'", "no", "'_", ",_", "'", "vaca", "nz", "a", "'_", ":_", "'", "lag", "o", "'_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "\\u", "position_", "=_", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "RECORD", "\\u", "CREATE_", ")_", ")_", "._", "prepare_", "(_", "(_", "3_", ",_", "rec_", ")_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "delete", "\\u", "msg_", "=_", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "RECORD", "\\u", "DELETE_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "delete", "\\u", "msg_", "._", "prepare_", "(_", "(_", "3_", ",_", "rec", "\\u", "position_", "._", "\\u", "rid_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "tx_", "=_", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "TX", "\\u", "COMMIT", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tx_", "._", "begin_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tx_", "._", "attach_", "(_", "rec", "\\u", "position", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tx_", "._", "attach_", "(_", "rec", "\\u", "position", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tx_", "._", "attach_", "(_", "rec", "\\u", "position", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tx_", "._", "attach_", "(_", "update", "\\u", "success_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tx_", "._", "attach_", "(_", "delete", "\\u", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "tx_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", ",_", "v_", "in_", "res_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "k_", "+_", "\"", " ", "->", " ", "\"_", "+_", "v_", "._", "vaca", "nz", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "assert_", "len_", "(_", "res_", ")_", "==_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "[_", "\"#", "3", ":", "0", "\"_", "]_", "._", "vaca", "nz", "a_", "==_", "'", "mont", "agn", "a", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "[_", "\"#", "3", ":", "2", "\"_", "]_", "._", "vaca", "nz", "a_", "==_", "'", "mar", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "[_", "\"#", "3", ":", "3", "\"_", "]_", "._", "vaca", "nz", "a_", "==_", "'", "mar", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "[_", "\"#", "3", ":", "4", "\"_", "]_", "._", "vaca", "nz", "a_", "==_", "'", "lag", "o", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "sid_", "=_", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "CONNECT", "_", ")_", ")_", "._", "prepare_", "(_", "(_", "\"", "root", "\"_", ",_", "\"", "root", "\"_", ")_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "DB", "\\u", "DROP", "_", ")_", ")_", "._", "prepare_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "db", "\\u", "name_", ",_", "pyo", "rien", "t_", "._", "STOR", "AGE", "\\u", "TYPE", "\\u", "MEM", "ORY", "_", "]_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Command", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "command_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "connection_", "=_", "pyo", "rien", "t_", "._", "Orient", "Socket_", "(_", "\"", "local", "host", "\"_", ",_", "242", "4_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "factory_", "=_", "pyo", "rien", "t_", "._", "Orient", "DB_", "(_", "connection_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "session", "\\u", "id_", "=_", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "CONNECT", "_", ")_", ")_", "._", "prepare_", "(_", "(_", "\"", "root", "\"_", ",_", "\"", "root", "\"_", ")_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "db", "\\u", "name_", "=_", "\"", "tmp", "\\u", "test", "1", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "at", " ", "the", " ", "end", " ", "drop", " ", "the", " ", "test", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "DB", "\\u", "DROP", "_", ")_", ")_", "._", "prepare_", "(_", "[_", "db", "\\u", "name_", ",_", "pyo", "rien", "t_", "._", "STOR", "AGE", "\\u", "TYPE", "\\u", "MEM", "ORY", "_", "]_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "pyo", "rien", "t_", "._", "Py", "Orient", "Command", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "(_", "str_", "(_", "e_", ")_", ")_", "\\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 ", " _", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "DB", "\\u", "CREATE_", ")_", ")_", "._", "prepare_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "db", "\\u", "name_", ",_", "pyo", "rien", "t_", "._", "DB", "\\u", "TYPE", "\\u", "GRAPH", "_", ",_", "pyo", "rien", "t_", "._", "STOR", "AGE", "\\u", "TYPE", "\\u", "MEM", "ORY", "_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "open", " ", "as", " ", "serialize", "2b", "inary", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "DB", "\\u", "OPEN_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cluster", "\\u", "info_", "=_", "msg_", "._", "prepare_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "db", "\\u", "name_", ",_", "\"", "admin", "\"_", ",_", "\"", "admin", "\"_", ",_", "pyo", "rien", "t_", "._", "DB", "\\u", "TYPE", "\\u", "DOCUMENT", "_", ",_", "\"\"_", ",_", "pyo", "rien", "t_", "._", "Orient", "Serializa", "tion_", "._", "CSV_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "###########", "######", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "create", "\\u", "class_", "=_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "COMMAND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ins", "\\u", "msg", "1_", "=_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "COMMAND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ins", "\\u", "msg", "2_", "=_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "COMMAND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ins", "\\u", "msg", "3_", "=_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "COMMAND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ins", "\\u", "msg", "4_", "=_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "COMMAND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "upd", "\\u", "msg", "5_", "=_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "RECORD", "\\u", "UPDATE_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "req", "\\u", "msg_", "=_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "COMMAND_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "create", "\\u", "class_", "._", "prepare_", "(_", "(_", "pyo", "rien", "t_", "._", "QUE", "RY", "\\u", "CMD_", ",_", "\"", "create", " ", "class", " ", "c\\u", "test", " ", "extend", "s", " ", "V", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ins", "\\u", "msg", "1_", "._", "prepare_", "(_", "(_", "pyo", "rien", "t_", "._", "QUE", "RY", "\\u", "CMD_", ",_", "\"", "insert", " ", "int", "o", " ", "c\\u", "test", " ", "(", " ", "Band", ",", " ", "Son", "g", " ", ")", " ", "values", "(", " ", "'", "AC", "/", "DC", "',", " ", "'", "Hell", "s", " ", "Bell", "s", "'", " ", ")\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ins", "\\u", "msg", "2_", "._", "prepare_", "(_", "(_", "pyo", "rien", "t_", "._", "QUE", "RY", "\\u", "CMD_", ",_", "\"", "insert", " ", "int", "o", " ", "c\\u", "test", " ", "(", " ", "Band", ",", " ", "Son", "g", " ", ")", " ", "values", "(", " ", "'", "AC", "/", "DC", "',", " ", "'", "Who", " ", "Made", " ", "Who", "'", " ", ")\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ins", "\\u", "msg", "3_", "._", "prepare_", "(_", "(_", "pyo", "rien", "t_", "._", "QUE", "RY", "\\u", "CMD_", ",_", "\"", "insert", " ", "int", "o", " ", "c\\u", "test", " ", "(", " ", "Band", ",", " ", "Son", "g", " ", ")", " ", "values", "(", " ", "'", "AC", "/", "DC", "',", " ", "'", "T", ".", "N", ".", "T", ".'", " ", ")\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ins", "\\u", "msg", "4_", "._", "prepare_", "(_", "(_", "pyo", "rien", "t_", "._", "QUE", "RY", "\\u", "CMD_", ",_", "\"", "insert", " ", "int", "o", " ", "c\\u", "test", " ", "(", " ", "Band", ",", " ", "Son", "g", " ", ")", " ", "values", "(", " ", "'", "AC", "/", "DC", "',", " ", "'", "Hig", "h", " ", "Volt", "age", "'", " ", ")\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "cluster_", "=_", "create", "\\u", "class_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "1_", "=_", "ins", "\\u", "msg", "1_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "2_", "=_", "ins", "\\u", "msg", "2_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "3_", "=_", "ins", "\\u", "msg", "3_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "4_", "=_", "ins", "\\u", "msg", "4_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rec", "1_", "=_", "rec", "1_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "upd", "\\u", "res_", "=_", "upd", "\\u", "msg", "5_", "._", "prepare_", "(_", "(_", "rec", "1_", "._", "\\u", "rid_", ",_", "rec", "1_", "._", "\\u", "rid_", ",_", "{_", "'", "Band", "'_", ":_", "'", "Meta", "lli", "ca", "'_", ",_", "'", "Son", "g", "'_", ":_", "'", "One", "'_", "}_", ")_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "res_", "=_", "req", "\\u", "msg_", "._", "prepare_", "(_", "[_", "pyo", "rien", "t_", "._", "QUE", "RY", "\\u", "SYNC", "_", ",_", "\"", "select", " ", "from", " ", "c\\u", "test", "\"_", "]_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "isinstance_", "(_", "cluster_", ",_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "rec", "1_", "._", "\\u", "rid_", "==_", "res_", "[_", "0_", "]_", "._", "\\u", "rid_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "rec", "1_", "._", "\\u", "version_", "!=_", "res_", "[_", "0_", "]_", "._", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "[_", "0_", "]_", "._", "\\u", "version_", "==_", "upd", "\\u", "res_", "[_", "0_", "]_", "._", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "len_", "(_", "res_", ")_", "==_", "4_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "[_", "0_", "]_", "._", "\\u", "rid_", "==_", "'#", "11", ":", "0", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "[_", "0_", "]_", "._", "Band_", "==_", "'", "Meta", "lli", "ca", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "[_", "0_", "]_", "._", "Song_", "==_", "'", "One", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "res_", "[_", "3_", "]_", "._", "Song_", "==_", "'", "Hig", "h", " ", "Volt", "age", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "x", " ", "in", " ", "res", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(\"", "###########", "#\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(\"", "%", "r", "\"", " ", "%", " ", "x", ".\\u", "rid_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(\"", "%", "r", "\"", " ", "%", " ", "x", ".\\u", "class_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(\"", "%", "r", "\"", " ", "%", " ", "x", ".\\u", "version_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(\"", "%", "r", "\"", " ", "%", " ", "x", ".", "Band_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(\"", "%", "r", "\"", " ", "%", " ", "x", ".", "Song_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "classe", "s", " ", "are", " ", "allow", "ed", " ", "in", " ", "record", " ", "create", "/", "update", "/", "load_", "\\u\\u\\uNL\\u\\u\\u_", "rec_", "=_", "{_", "'@", "c\\u", "test", "'_", ":_", "{_", "'", "allo", "ggi", "o", "'_", ":_", "'", "casa", "'_", ",_", "'", "lav", "oro", "'_", ":_", "'", "uff", "icio", "'_", ",_", "'", "vaca", "nz", "a", "'_", ":_", "'", "mar", "e", "'_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rec", "\\u", "position_", "=_", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "RECORD", "\\u", "CREATE_", ")_", ")_", "._", "prepare_", "(_", "(_", "cluster_", "[_", "0_", "]_", ",_", "rec_", ")_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "(_", "\"", "New", " ", "Rec", " ", "Position", ":", " ", "%", "s", "\"_", "%_", "rec", "\\u", "position_", "._", "\\u", "rid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "rec", "\\u", "position_", "._", "\\u", "rid_", "is_", "not_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "rec_", "=_", "{_", "'@", "c\\u", "test", "'_", ":_", "{_", "'", "allo", "ggi", "o", "'_", ":_", "'", "albe", "rg", "o", "'_", ",_", "'", "lav", "oro", "'_", ":_", "'", "uff", "icio", "'_", ",_", "'", "vaca", "nz", "a", "'_", ":_", "'", "mont", "agn", "a", "'_", "}_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "update", "\\u", "success_", "=_", "(_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "RECORD", "\\u", "UPDATE_", ")_", ")_", "._", "prepare_", "(_", "(_", "rec", "\\u", "position_", "._", "\\u", "rid_", ",_", "rec", "\\u", "position_", "._", "\\u", "rid_", ",_", "rec_", ")_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "req", "\\u", "msg_", "=_", "factory_", "._", "get", "\\u", "message_", "(_", "pyo", "rien", "t_", "._", "RECORD", "\\u", "LOAD", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "res_", "=_", "req", "\\u", "msg_", "._", "prepare_", "(_", "[_", "rec", "\\u", "position_", "._", "\\u", "rid_", ",_", "\"*", ":-", "1", "\"_", "]_", ")_", "._", "send_", "(_", ")_", "._", "fetch", "\\u", "response_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(", "res", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(", "res", ".\\u", "rid", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(", "res", ".\\u", "class", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(", "res", ".\\u", "version", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(", "res", ".", "allo", "ggi", "o", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(", "res", ".", "lav", "oro", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(", "res", ".", "vaca", "nz", "a", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "assert_", "res_", "._", "\\u", "rid_", "==_", "\"#", "11", ":", "4", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "\\u", "class_", "==_", "\"", "c\\u", "test", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "res_", "._", "allo", "ggi", "o_", "==_", "'", "albe", "rg", "o", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "hasattr_", "(_", "res_", ",_", "'", "Band", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "not_", "hasattr_", "(_", "res_", ",_", "'", "Son", "g", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "print", "(\"", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "#", " ", "at", " ", "the", " ", "end", " ", "drop", " ", "the", " ", "test", " ", "database_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", " ", "Db", "Drop", "Messag", "e", "(", " ", "connecti", "on", " ", ")", " ", ").", "prepar", "e", "([", "db", "\\u", "name", ",", " ", "STOR", "AGE", "\\u", "TYPE", "\\u", "MEM", "ORY", "])", " ", "\\\\_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", ".", "send", "()", ".", "fetch", "\\u", "response", "()", "_", "\\u\\u\\uNL\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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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 ]
Illegal raise
nikcub/floyd/floyd/templating/jinja.py
[ { "content": "def render(template_name, template_vars={}, template_set='site', template_theme=None, template_extension='html', template_content=None):\n \"\"\"Given a template path, a template name and template variables\n will return rendered content using jinja2 library\n \n :param template_path: Path to template directory\n :param template_name: Name of template\n :param vars: (Optional) Template variables\n \"\"\"\n global _jinja_env\n \n if not _jinja_env:\n raise 'Jinja env not setup'\n\n try:\n _jinja_env.filters['timesince'] = timesince\n _jinja_env.filters['timeuntil'] = timeuntil\n _jinja_env.filters['date'] = date_format\n _jinja_env.filters['time'] = time_format\n _jinja_env.filters['shortdate'] = short_date\n _jinja_env.filters['isodate'] = iso_date\n _jinja_env.filters['rfcdate'] = rfc2822_date\n _jinja_env.filters['tformat'] = datetimeformat\n _jinja_env.filters['timestamp'] = timestamp\n except NameError as errstr:\n logging.info('Helper import error: %s' % errstr)\n\n _template_name = \"%s.%s\" % (template_name, template_extension)\n template = _jinja_env.get_template(_template_name, parent=template_theme)\n \n return template.render(template_vars)", "metadata": "root.render", "header": "['module', '___EOS___']", "index": 209 } ]
[ { "span": "raise 'Jinja env not setup'", "start_line": 220, "start_column": 4, "end_line": 220, "end_column": 31 } ]
[]
1
true
[ "[CLS]_", "Il", "lega", "l_", "raise_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "render_", "(_", "template", "\\u", "name_", ",_", "template", "\\u", "vars_", "=_", "{_", "}_", ",_", "template", "\\u", "set_", "=_", "'", "site", "'_", ",_", "template", "\\u", "theme_", "=_", "None_", ",_", "template", "\\u", "extension_", "=_", "'", "html", "'_", ",_", "template", "\\u", "content_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Give", "n", " ", "a", " ", "template", " ", "path", ",", " ", "a", " ", "template", " ", "name", " ", "and", " ", "template", " ", "variab", "les", "\\", "10", ";", " ", " ", "will", " ", "return", " ", "render", "ed", " ", "content", " ", "usi", "ng", " ", "jin", "ja", "2", " ", "librar", "y", "\\", "10", ";", " ", " ", "\\", "10", ";", " ", " ", ":", "param", " ", "template", "\\u", "path", ":", " ", "Path", " ", "to", " ", "template", " ", "director", "y", "\\", "10", ";", " ", " ", ":", "param", " ", "template", "\\u", "name", ":", " ", "Name", " ", "of", " ", "template", "\\", "10", ";", " ", " ", ":", "param", " ", "vars", ":", " ", "(", "Optio", "nal", ")", " ", "Templa", "te", " ", "variab", "les", "\\", "10", ";", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "global_", "\\u", "jin", "ja", "\\u", "env_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "\\u", "jin", "ja", "\\u", "env_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "'", "Jin", "ja", " ", "env", " ", "not", " ", "setup", "'_", "\\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", "jin", "ja", "\\u", "env_", "._", "filters_", "[_", "'", "times", "inc", "e", "'_", "]_", "=_", "times", "inc", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "jin", "ja", "\\u", "env_", "._", "filters_", "[_", "'", "time", "unti", "l", "'_", "]_", "=_", "time", "until_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "jin", "ja", "\\u", "env_", "._", "filters_", "[_", "'", "date", "'_", "]_", "=_", "date", "\\u", "format_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "jin", "ja", "\\u", "env_", "._", "filters_", "[_", "'", "time", "'_", "]_", "=_", "time", "\\u", "format_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "jin", "ja", "\\u", "env_", "._", "filters_", "[_", "'", "short", "date", "'_", "]_", "=_", "short", "\\u", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "jin", "ja", "\\u", "env_", "._", "filters_", "[_", "'", "iso", "date", "'_", "]_", "=_", "iso", "\\u", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "jin", "ja", "\\u", "env_", "._", "filters_", "[_", "'", "rfc", "date", "'_", "]_", "=_", "rfc", "282", "2", "\\u", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "jin", "ja", "\\u", "env_", "._", "filters_", "[_", "'", "tfo", "rmat", "'_", "]_", "=_", "datetime", "format_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u", "jin", "ja", "\\u", "env_", "._", "filters_", "[_", "'", "timestamp", "'_", "]_", "=_", "timestamp_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Name", "Error_", "as_", "errst", "r_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "info_", "(_", "'", "Help", "er", " ", "import", " ", "error", ":", " ", "%", "s", "'_", "%_", "errst", "r_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u", "template", "\\u", "name_", "=_", "\"%", "s", ".", "%", "s", "\"_", "%_", "(_", "template", "\\u", "name_", ",_", "template", "\\u", "extension_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "template_", "=_", "\\u", "jin", "ja", "\\u", "env_", "._", "get", "\\u", "template_", "(_", "\\u", "template", "\\u", "name_", ",_", "parent_", "=_", "template", "\\u", "theme_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "template_", "._", "render_", "(_", "template", "\\u", "vars_", ")_", "\\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, 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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 ]
Variable defined multiple times
appdotnet/ADNpy/tests/test_api.py
[ { "content": " def test_post(self):\n text = u'awesome'\n post, meta = self.api.create_post(data={'text': text})\n self.assertEquals(post.text, text)\n\n post, meta = self.api.get_post(post)\n\n post, meta = self.api.delete_post(post)\n post, meta = self.api.create_post(data={'text': text})\n post, meta = post.delete()\n\n post, meta = self.api.repost_post(14265380)\n post, meta = self.api.unrepost_post(14265380)\n\n post, meta = self.api.star_post(14265380)\n post, meta = self.api.unstar_post(14265380)\n\n posts, meta = self.api.get_posts(ids='1,2,3')\n self.assertEquals(len(posts), 3)\n\n posts, meta = self.api.users_posts(3)\n\n posts, meta = self.api.users_starred_posts(3)\n posts, meta = self.api.users_mentioned_posts(3)\n\n posts, meta = self.api.posts_with_hashtag('awesome')\n\n posts, meta = self.api.posts_with_hashtag(1)\n\n posts, meta = self.api.users_post_stream()\n posts, meta = self.api.users_post_stream_unified()\n\n posts, meta = self.api.posts_stream_global()\n\n # post, meta = self.api.report_post(1)\n\n posts, meta = self.api.post_search(text='awesome')", "metadata": "root.AdnpyAPITests.test_post", "header": "['class', 'AdnpyAPITests', '(', 'AdnpyTestCase', ')', ':', '___EOS___']", "index": 18 }, { "content": " def test_user(self):\n display_name = u'tester %s' % (time.time())\n user, meta = self.api.get_user('me')\n self.assertEquals(self.username, user.username)\n old_name = user.name\n user.name = display_name\n cwd = os.path.dirname(__file__)\n del user.description['entities']\n user, meta = self.api.update_user('me', data=user)\n self.assertEquals(display_name, user.name)\n\n user, meta = self.api.patch_user('me', data={'name': old_name})\n self.assertEquals(old_name, user.name)\n\n users, meta = self.api.get_users(ids='1,2,3')\n self.assertEquals(len(users), 3)\n\n # XXX: Need to figure out how I can record, and replay these calls, but they work\n\n with open(cwd + '/data/avatar.png') as avatar:\n user, meta = self.api.update_avatar('me', files={'avatar': avatar})\n\n with open(cwd + '/data/cover.png') as cover:\n user, meta = self.api.update_cover('me', files={'cover': cover})\n\n user, meta = self.api.follow_user(3)\n user, meta = self.api.unfollow_user(3)\n\n user, meta = self.api.mute_user(3)\n user, meta = self.api.unmute_user(3)\n\n user, meta = self.api.block_user(3)\n user, meta = self.api.unblock_user(3)\n\n users, meta = self.api.user_search(q='@voidfiles')\n\n users, meta = self.api.users_following(3)\n users, meta = self.api.users_followers(3)\n\n users, meta = self.api.users_following_ids(3)\n users, meta = self.api.users_followers_ids(3)\n\n users, meta = self.api.users_muted_users('me')\n users, meta = self.api.users_muted_users_ids('me')\n\n users, meta = self.api.users_blocked_users('me')\n\n # Add in testing for app access tokens\n #users, meta = self.api.users_blocked_user_ids('me')\n\n users, meta = self.api.users_reposted_post(1)\n users, meta = self.api.users_starred_post(1)", "metadata": "root.AdnpyAPITests.test_user", "header": "['class', 'AdnpyAPITests', '(', 'AdnpyTestCase', ')', ':', '___EOS___']", "index": 56 }, { "content": " def test_channel(self):\n\n channels, meta = self.api.subscribed_channels()\n\n channel, meta = self.api.create_channel(data={\n 'type': 'com.example.channel',\n 'writers': {\n 'user_ids': ['@voidfiles'],\n 'immutable': False,\n }\n })\n\n channel_fetched, meta = self.api.get_channel(channel)\n self.assertEquals(channel.id, channel_fetched.id)\n\n channels, meta = self.api.get_channels(ids=channel_fetched.id)\n\n channels, meta = self.api.users_channels()\n\n num_unread, meta = self.api.num_unread_pm_channels()\n\n channel_update = {\n 'id': channel.id,\n 'writers': {\n 'user_ids': [],\n }\n }\n\n channel, meta = self.api.update_channel(channel, data=channel_update)\n self.assertEquals(channel_update['writers']['user_ids'], channel.writers.user_ids)\n\n channel, meta = self.api.subscribe_channel(1383)\n channel, meta = self.api.unsubscribe_channel(1383)\n\n users, meta = self.api.subscribed_users(1383)\n users, meta = self.api.subscribed_user_ids(1383)\n\n channel_user_ids, meta = self.api.subscribed_user_ids_for_channels(ids='1383,6313')\n\n channel, meta = self.api.mute_channel(1383)\n channels, meta = self.api.muted_channels(1383)\n channel, meta = self.api.unmute_channel(1383)", "metadata": "root.AdnpyAPITests.test_channel", "header": "['class', 'AdnpyAPITests', '(', 'AdnpyTestCase', ')', ':', '___EOS___']", "index": 109 }, { "content": " def test_message(self):\n\n message1, meta = self.api.create_message(27024, data={'text': \"awesome 1\"})\n message2, meta = self.api.create_message(27024, data={'text': \"awesome 2\"})\n message, meta = self.api.get_message(27024, message1)\n messages, meta = self.api.get_messages(ids='%s, %s' % (message1.id, message2.id))\n messages, meta = self.api.users_messages()\n messages, meta = self.api.get_channel_messages(27024)\n\n message, meta = self.api.delete_message(27024, message1)\n message, meta = self.api.delete_message(27024, message2)", "metadata": "root.AdnpyAPITests.test_message", "header": "['class', 'AdnpyAPITests', '(', 'AdnpyTestCase', ')', ':', '___EOS___']", "index": 152 }, { "content": " def test_stream_filters(self):\n # Reset\n stream_filters, meta = self.api.delete_all_filters()\n\n filter_def = {\n \"clauses\": [\n {\n \"field\": \"/data/entities/hashtags/*/name\",\n \"object_type\": \"post\",\n \"operator\": \"matches\",\n \"value\": \"rollout\"\n }\n ],\n \"id\": \"1\",\n \"match_policy\": \"include_any\",\n \"name\": \"Posts about rollouts\"\n }\n\n stream_filter, meta = self.api.create_filter(data=filter_def)\n stream_filter, meta = self.api.get_filter(stream_filter)\n filter_def['clauses'] += [{\n \"field\": \"/data/entities/hashtags/*/name\",\n \"object_type\": \"post\",\n \"operator\": \"matches\",\n \"value\": \"bug\"\n }]\n\n stream_filter, meta = self.api.update_filter(stream_filter, data=filter_def)\n self.assertEquals(len(stream_filter.clauses), 2)\n stream_filter, meta = self.api.delete_filter(stream_filter)\n stream_filter, meta = self.api.create_filter(data=filter_def)\n filter_def['id'] = '2'\n stream_filter, meta = self.api.create_filter(data=filter_def)\n stream_filters, meta = self.api.get_filters()\n self.assertEquals(len(stream_filters), 2)\n stream_filters, meta = self.api.delete_all_filters()\n stream_filters, meta = self.api.get_filters()\n self.assertEquals(len(stream_filters), 0)", "metadata": "root.AdnpyAPITests.test_stream_filters", "header": "['class', 'AdnpyAPITests', '(', 'AdnpyTestCase', ')', ':', '___EOS___']", "index": 225 }, { "content": " def test_app_stream(self):\n app_access_token, token = get_app_access_token(self.client_id, self.client_secret)\n self.api.add_authorization_token(app_access_token)\n # Reset\n self.api.delete_all_streams()\n\n stream_def = {\n \"object_types\": [\n \"post\"\n ],\n \"type\": \"long_poll\",\n \"key\": \"rollout_stream\"\n }\n\n app_stream, meta = self.api.create_stream(data=stream_def)\n app_stream, meta = self.api.get_stream(app_stream)\n\n stream_def['object_types'] += [\"star\"]\n\n app_stream, meta = self.api.update_stream(app_stream, data=stream_def)\n self.assertEquals(len(app_stream.object_types), 2)\n app_stream, meta = self.api.delete_stream(app_stream)\n app_stream, meta = self.api.create_stream(data=stream_def)\n stream_def['key'] = \"rollout_stream_2\"\n app_stream, meta = self.api.create_stream(data=stream_def)\n app_streams, meta = self.api.get_streams()\n self.assertEquals(len(app_streams), 2)\n app_streams, meta = self.api.delete_all_streams()\n app_streams, meta = self.api.get_streams()\n self.assertEquals(len(app_streams), 0)", "metadata": "root.AdnpyAPITests.test_app_stream", "header": "['class', 'AdnpyAPITests', '(', 'AdnpyTestCase', ')', ':', '___EOS___']", "index": 264 } ]
[ { "span": "post,", "start_line": 25, "start_column": 8, "end_line": 25, "end_column": 12 }, { "span": "meta ", "start_line": 25, "start_column": 14, "end_line": 25, "end_column": 18 }, { "span": "post,", "start_line": 27, "start_column": 8, "end_line": 27, "end_column": 12 }, { "span": "meta ", "start_line": 27, "start_column": 14, "end_line": 27, "end_column": 18 }, { "span": "post,", "start_line": 29, "start_column": 8, "end_line": 29, "end_column": 12 }, { "span": "meta ", "start_line": 29, "start_column": 14, "end_line": 29, "end_column": 18 }, { "span": "post,", "start_line": 30, "start_column": 8, "end_line": 30, "end_column": 12 }, { "span": "meta ", "start_line": 30, "start_column": 14, "end_line": 30, "end_column": 18 }, { "span": "post,", "start_line": 32, "start_column": 8, "end_line": 32, "end_column": 12 }, { "span": "meta ", "start_line": 32, "start_column": 14, "end_line": 32, "end_column": 18 }, { "span": "posts,", "start_line": 38, "start_column": 8, "end_line": 38, "end_column": 13 }, { "span": "meta ", "start_line": 38, "start_column": 15, "end_line": 38, "end_column": 19 }, { "span": "posts,", "start_line": 40, "start_column": 8, "end_line": 40, "end_column": 13 }, { "span": "meta ", "start_line": 40, "start_column": 15, "end_line": 40, "end_column": 19 }, { "span": "posts,", "start_line": 41, "start_column": 8, "end_line": 41, "end_column": 13 }, { "span": "meta ", "start_line": 41, "start_column": 15, "end_line": 41, "end_column": 19 }, { "span": "posts,", "start_line": 43, "start_column": 8, "end_line": 43, "end_column": 13 }, { "span": "meta ", "start_line": 43, "start_column": 15, "end_line": 43, "end_column": 19 }, { "span": "posts,", "start_line": 45, "start_column": 8, "end_line": 45, "end_column": 13 }, { "span": "meta ", "start_line": 45, "start_column": 15, "end_line": 45, "end_column": 19 }, { "span": "posts,", "start_line": 47, "start_column": 8, "end_line": 47, "end_column": 13 }, { "span": "meta ", "start_line": 47, "start_column": 15, "end_line": 47, "end_column": 19 }, { "span": "posts,", "start_line": 48, "start_column": 8, "end_line": 48, "end_column": 13 }, { "span": "meta ", "start_line": 48, "start_column": 15, "end_line": 48, "end_column": 19 }, { "span": "posts,", "start_line": 50, "start_column": 8, "end_line": 50, "end_column": 13 }, { "span": "meta ", "start_line": 50, "start_column": 15, "end_line": 50, "end_column": 19 }, { "span": "user,", "start_line": 76, "start_column": 12, "end_line": 76, "end_column": 16 }, { "span": "meta ", "start_line": 76, "start_column": 18, "end_line": 76, "end_column": 22 }, { "span": "user,", "start_line": 79, "start_column": 12, "end_line": 79, "end_column": 16 }, { "span": "meta ", "start_line": 79, "start_column": 18, "end_line": 79, "end_column": 22 }, { "span": "user,", "start_line": 81, "start_column": 8, "end_line": 81, "end_column": 12 }, { "span": "meta ", "start_line": 81, "start_column": 14, "end_line": 81, "end_column": 18 }, { "span": "user,", "start_line": 82, "start_column": 8, "end_line": 82, "end_column": 12 }, { "span": "meta ", "start_line": 82, "start_column": 14, "end_line": 82, "end_column": 18 }, { "span": "user,", "start_line": 84, "start_column": 8, "end_line": 84, "end_column": 12 }, { "span": "meta ", "start_line": 84, "start_column": 14, "end_line": 84, "end_column": 18 }, { "span": "user,", "start_line": 85, "start_column": 8, "end_line": 85, "end_column": 12 }, { "span": "meta ", "start_line": 85, "start_column": 14, "end_line": 85, "end_column": 18 }, { "span": "user,", "start_line": 87, "start_column": 8, "end_line": 87, "end_column": 12 }, { "span": "meta ", "start_line": 87, "start_column": 14, "end_line": 87, "end_column": 18 }, { "span": "users,", "start_line": 90, "start_column": 8, "end_line": 90, "end_column": 13 }, { "span": "meta ", "start_line": 90, "start_column": 15, "end_line": 90, "end_column": 19 }, { "span": "users,", "start_line": 92, "start_column": 8, "end_line": 92, "end_column": 13 }, { "span": "meta ", "start_line": 92, "start_column": 15, "end_line": 92, "end_column": 19 }, { "span": "users,", "start_line": 93, "start_column": 8, "end_line": 93, "end_column": 13 }, { "span": "meta ", "start_line": 93, "start_column": 15, "end_line": 93, "end_column": 19 }, { "span": "users,", "start_line": 95, "start_column": 8, "end_line": 95, "end_column": 13 }, { "span": "meta ", "start_line": 95, "start_column": 15, "end_line": 95, "end_column": 19 }, { "span": "users,", "start_line": 96, "start_column": 8, "end_line": 96, "end_column": 13 }, { "span": "meta ", "start_line": 96, "start_column": 15, "end_line": 96, "end_column": 19 }, { "span": "users,", "start_line": 98, "start_column": 8, "end_line": 98, "end_column": 13 }, { "span": "meta ", "start_line": 98, "start_column": 15, "end_line": 98, "end_column": 19 }, { "span": "users,", "start_line": 99, "start_column": 8, "end_line": 99, "end_column": 13 }, { "span": "meta ", "start_line": 99, "start_column": 15, "end_line": 99, "end_column": 19 }, { "span": "users,", "start_line": 101, "start_column": 8, "end_line": 101, "end_column": 13 }, { "span": "meta ", "start_line": 101, "start_column": 15, "end_line": 101, "end_column": 19 }, { "span": "users,", "start_line": 106, "start_column": 8, "end_line": 106, "end_column": 13 }, { "span": "meta ", "start_line": 106, "start_column": 15, "end_line": 106, "end_column": 19 }, { "span": "channels,", "start_line": 111, "start_column": 8, "end_line": 111, "end_column": 16 }, { "span": "meta ", "start_line": 111, "start_column": 18, "end_line": 111, "end_column": 22 }, { "span": "channels,", "start_line": 124, "start_column": 8, "end_line": 124, "end_column": 16 }, { "span": "meta ", "start_line": 124, "start_column": 18, "end_line": 124, "end_column": 22 }, { "span": "channels,", "start_line": 126, "start_column": 8, "end_line": 126, "end_column": 16 }, { "span": "meta ", "start_line": 126, "start_column": 18, "end_line": 126, "end_column": 22 }, { "span": "channel,", "start_line": 140, "start_column": 8, "end_line": 140, "end_column": 15 }, { "span": "meta ", "start_line": 140, "start_column": 17, "end_line": 140, "end_column": 21 }, { "span": "channel,", "start_line": 141, "start_column": 8, "end_line": 141, "end_column": 15 }, { "span": "meta ", "start_line": 141, "start_column": 17, "end_line": 141, "end_column": 21 }, { "span": "users,", "start_line": 143, "start_column": 8, "end_line": 143, "end_column": 13 }, { "span": "meta ", "start_line": 143, "start_column": 15, "end_line": 143, "end_column": 19 }, { "span": "channel,", "start_line": 148, "start_column": 8, "end_line": 148, "end_column": 15 }, { "span": "meta ", "start_line": 148, "start_column": 17, "end_line": 148, "end_column": 21 }, { "span": "message,", "start_line": 156, "start_column": 8, "end_line": 156, "end_column": 15 }, { "span": "meta ", "start_line": 156, "start_column": 17, "end_line": 156, "end_column": 21 }, { "span": "messages,", "start_line": 157, "start_column": 8, "end_line": 157, "end_column": 16 }, { "span": "meta ", "start_line": 157, "start_column": 18, "end_line": 157, "end_column": 22 }, { "span": "messages,", "start_line": 158, "start_column": 8, "end_line": 158, "end_column": 16 }, { "span": "meta ", "start_line": 158, "start_column": 18, "end_line": 158, "end_column": 22 }, { "span": "message,", "start_line": 161, "start_column": 8, "end_line": 161, "end_column": 15 }, { "span": "meta ", "start_line": 161, "start_column": 17, "end_line": 161, "end_column": 21 }, { "span": "stream_filters,", "start_line": 227, "start_column": 8, "end_line": 227, "end_column": 22 }, { "span": "meta ", "start_line": 227, "start_column": 24, "end_line": 227, "end_column": 28 }, { "span": "stream_filter,", "start_line": 254, "start_column": 8, "end_line": 254, "end_column": 21 }, { "span": "meta ", "start_line": 254, "start_column": 23, "end_line": 254, "end_column": 27 }, { "span": "stream_filter,", "start_line": 255, "start_column": 8, "end_line": 255, "end_column": 21 }, { "span": "meta ", "start_line": 255, "start_column": 23, "end_line": 255, "end_column": 27 }, { "span": "stream_filters,", "start_line": 260, "start_column": 8, "end_line": 260, "end_column": 22 }, { "span": "meta ", "start_line": 260, "start_column": 24, "end_line": 260, "end_column": 28 }, { "span": "app_stream,", "start_line": 285, "start_column": 8, "end_line": 285, "end_column": 18 }, { "span": "meta ", "start_line": 285, "start_column": 20, "end_line": 285, "end_column": 24 }, { "span": "app_stream,", "start_line": 286, "start_column": 8, "end_line": 286, "end_column": 18 }, { "span": "meta ", "start_line": 286, "start_column": 20, "end_line": 286, "end_column": 24 }, { "span": "app_streams,", "start_line": 291, "start_column": 8, "end_line": 291, "end_column": 19 }, { "span": "meta ", "start_line": 291, "start_column": 21, "end_line": 291, "end_column": 25 } ]
[ { "span": "post,", "start_line": 26, "start_column": 8, "end_line": 26, "end_column": 12 }, { "span": "meta ", "start_line": 26, "start_column": 14, "end_line": 26, "end_column": 18 }, { "span": "post,", "start_line": 33, "start_column": 8, "end_line": 33, "end_column": 12 }, { "span": "meta ", "start_line": 33, "start_column": 14, "end_line": 33, "end_column": 18 }, { "span": "posts,", "start_line": 54, "start_column": 8, "end_line": 54, "end_column": 13 }, { "span": "meta ", "start_line": 54, "start_column": 15, "end_line": 54, "end_column": 19 }, { "span": "user,", "start_line": 88, "start_column": 8, "end_line": 88, "end_column": 12 }, { "span": "meta ", "start_line": 88, "start_column": 14, "end_line": 88, "end_column": 18 }, { "span": "users,", "start_line": 107, "start_column": 8, "end_line": 107, "end_column": 13 }, { "span": "meta ", "start_line": 107, "start_column": 15, "end_line": 107, "end_column": 19 }, { "span": "meta ", "start_line": 113, "start_column": 17, "end_line": 113, "end_column": 21 }, { "span": "meta ", "start_line": 128, "start_column": 20, "end_line": 128, "end_column": 24 }, { "span": "users,", "start_line": 144, "start_column": 8, "end_line": 144, "end_column": 13 }, { "span": "meta ", "start_line": 144, "start_column": 15, "end_line": 144, "end_column": 19 }, { "span": "channels,", "start_line": 149, "start_column": 8, "end_line": 149, "end_column": 16 }, { "span": "meta ", "start_line": 149, "start_column": 18, "end_line": 149, "end_column": 22 }, { "span": "channel,", "start_line": 150, "start_column": 8, "end_line": 150, "end_column": 15 }, { "span": "messages,", "start_line": 159, "start_column": 8, "end_line": 159, "end_column": 16 }, { "span": "meta ", "start_line": 159, "start_column": 18, "end_line": 159, "end_column": 22 }, { "span": "message,", "start_line": 162, "start_column": 8, "end_line": 162, "end_column": 15 }, { "span": "meta ", "start_line": 162, "start_column": 17, "end_line": 162, "end_column": 21 }, { "span": "meta ", "start_line": 243, "start_column": 23, "end_line": 243, "end_column": 27 }, { "span": "stream_filter,", "start_line": 257, "start_column": 8, "end_line": 257, "end_column": 21 }, { "span": "meta ", "start_line": 257, "start_column": 23, "end_line": 257, "end_column": 27 }, { "span": "stream_filters,", "start_line": 258, "start_column": 8, "end_line": 258, "end_column": 22 }, { "span": "stream_filters,", "start_line": 261, "start_column": 8, "end_line": 261, "end_column": 22 }, { "span": "meta ", "start_line": 261, "start_column": 24, "end_line": 261, "end_column": 28 }, { "span": "app_stream,", "start_line": 288, "start_column": 8, "end_line": 288, "end_column": 18 }, { "span": "meta ", "start_line": 288, "start_column": 20, "end_line": 288, "end_column": 24 }, { "span": "app_streams,", "start_line": 292, "start_column": 8, "end_line": 292, "end_column": 19 }, { "span": "meta ", "start_line": 292, "start_column": 21, "end_line": 292, "end_column": 25 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "class_", "Ad", "npy", "API", "Tests_", "(_", "Ad", "npy", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "post_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "text_", "=_", "u", "'", "aw", "eso", "me", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "create", "\\u", "post_", "(_", "data_", "=_", "{_", "'", "text", "'_", ":_", "text_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "post_", "._", "text_", ",_", "text_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "post_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "get", "\\u", "post_", "(_", "post_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "post_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "delete", "\\u", "post_", "(_", "post_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "create", "\\u", "post_", "(_", "data_", "=_", "{_", "'", "text", "'_", ":_", "text_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", ",_", "meta_", "=_", "post_", "._", "delete_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "post_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "repos", "t", "\\u", "post_", "(_", "142", "653", "80_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "unre", "post", "\\u", "post_", "(_", "142", "653", "80_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "post_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "star", "\\u", "post_", "(_", "142", "653", "80_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "post_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "unsta", "r", "\\u", "post_", "(_", "142", "653", "80_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "posts_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "get", "\\u", "posts_", "(_", "ids_", "=_", "'", "1", ",", "2", ",", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "posts_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "posts_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "posts_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "posts_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "starred", "\\u", "posts_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "posts_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "mentioned", "\\u", "posts_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "posts_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "posts", "\\u", "with", "\\u", "hashtag", "_", "(_", "'", "aw", "eso", "me", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "posts_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "posts", "\\u", "with", "\\u", "hashtag", "_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "posts_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "post", "\\u", "stream_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "posts_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "post", "\\u", "stream", "\\u", "unifie", "d_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "posts_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "posts", "\\u", "stream", "\\u", "global_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "post", ",", " ", "meta", " ", "=", " ", "self", ".", "api", ".", "report", "\\u", "post", "(", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "posts_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "post", "\\u", "search_", "(_", "text_", "=_", "'", "aw", "eso", "me", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ad", "npy", "API", "Tests_", "(_", "Ad", "npy", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "user_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "display", "\\u", "name_", "=_", "u", "'", "teste", "r", " ", "%", "s", "'_", "%_", "(_", "time_", "._", "time_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "get", "\\u", "user_", "(_", "'", "me", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "self_", "._", "username_", ",_", "user_", "._", "username_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "old", "\\u", "name_", "=_", "user_", "._", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", "._", "name_", "=_", "display", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cwd_", "=_", "os_", "._", "path_", "._", "dirname_", "(_", "\\u\\u", "file\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "del_", "user_", "._", "description_", "[_", "'", "entit", "ies", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "update", "\\u", "user_", "(_", "'", "me", "'_", ",_", "data_", "=_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "display", "\\u", "name_", ",_", "user_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "user_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "patch", "\\u", "user_", "(_", "'", "me", "'_", ",_", "data_", "=_", "{_", "'", "name", "'_", ":_", "old", "\\u", "name_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "old", "\\u", "name_", ",_", "user_", "._", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "users_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "get", "\\u", "users_", "(_", "ids_", "=_", "'", "1", ",", "2", ",", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "users_", ")_", ",_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "XX", "X", ":", " ", "Ne", "ed", " ", "to", " ", "figure", " ", "out", " ", "how", " ", "I", " ", "can", " ", "record", ",", " ", "and", " ", "repla", "y", " ", "these", " ", "calls", ",", " ", "but", " ", "the", "y", " ", "work_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "with_", "open_", "(_", "cwd_", "+_", "'/", "data", "/", "avat", "ar", ".", "png", "'_", ")_", "as_", "avatar_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "update", "\\u", "avatar_", "(_", "'", "me", "'_", ",_", "files_", "=_", "{_", "'", "avat", "ar", "'_", ":_", "avatar_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "with_", "open_", "(_", "cwd_", "+_", "'/", "data", "/", "cover", ".", "png", "'_", ")_", "as_", "cover_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "user_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "update", "\\u", "cover_", "(_", "'", "me", "'_", ",_", "files_", "=_", "{_", "'", "cover", "'_", ":_", "cover_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "user_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "follow", "\\u", "user_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "unfol", "low", "\\u", "user_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "user_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "mute", "\\u", "user_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "unm", "ute", "\\u", "user_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "user_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "block", "\\u", "user_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "user_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "unbl", "ock", "\\u", "user_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "users_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "user", "\\u", "search_", "(_", "q_", "=_", "'@", "voi", "dfile", "s", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "users_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "following_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "users_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "followers", "_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "users_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "follow", "ing", "\\u", "ids_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "users_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "followers", "\\u", "ids_", "(_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "users_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "muted", "\\u", "users_", "(_", "'", "me", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "users_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "muted", "\\u", "users", "\\u", "ids_", "(_", "'", "me", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "users_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "block", "ed", "\\u", "users_", "(_", "'", "me", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "in", " ", "testi", "ng", " ", "for", " ", "app", " ", "access", " ", "tokens_", "\\u\\u\\uNL\\u\\u\\u_", "#", "users", ",", " ", "meta", " ", "=", " ", "self", ".", "api", ".", "users", "\\u", "block", "ed", "\\u", "user", "\\u", "ids", "('", "me", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "users_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "repos", "ted", "\\u", "post_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "users_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "starred", "\\u", "post_", "(_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ad", "npy", "API", "Tests_", "(_", "Ad", "npy", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "channel_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "channels_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "subscribed", "\\u", "channels_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "channel_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "create", "\\u", "channel_", "(_", "data_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "type", "'_", ":_", "'", "com", ".", "example", ".", "channel", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "writer", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "ids", "'_", ":_", "[_", "'@", "voi", "dfile", "s", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "immutable", "'_", ":_", "False_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "channel", "\\u", "fetched", "_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "get", "\\u", "channel_", "(_", "channel_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "channel_", "._", "id_", ",_", "channel", "\\u", "fetched", "_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "channels_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "get", "\\u", "channels_", "(_", "ids_", "=_", "channel", "\\u", "fetched", "_", "._", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "channels_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "channels_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "num", "\\u", "unread", "_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "num", "\\u", "unread", "\\u", "pm", "\\u", "channels_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "channel", "\\u", "update_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "id", "'_", ":_", "channel_", "._", "id_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "writer", "s", "'_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "user", "\\u", "ids", "'_", ":_", "[_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "channel_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "update", "\\u", "channel_", "(_", "channel_", ",_", "data_", "=_", "channel", "\\u", "update_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "channel", "\\u", "update_", "[_", "'", "writer", "s", "'_", "]_", "[_", "'", "user", "\\u", "ids", "'_", "]_", ",_", "channel_", "._", "writers_", "._", "user", "\\u", "ids_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "channel_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "subscribe", "\\u", "channel_", "(_", "138", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "channel_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "unsubscribe", "\\u", "channel_", "(_", "138", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "users_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "subscribed", "\\u", "users_", "(_", "138", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "users_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "subscribed", "\\u", "user", "\\u", "ids_", "(_", "138", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "channel", "\\u", "user", "\\u", "ids_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "subscribed", "\\u", "user", "\\u", "ids", "\\u", "for", "\\u", "channels_", "(_", "ids_", "=_", "'", "138", "3", ",", "631", "3", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "channel_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "mute", "\\u", "channel_", "(_", "138", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "channels_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "muted", "\\u", "channels_", "(_", "138", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "channel_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "unm", "ute", "\\u", "channel_", "(_", "138", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ad", "npy", "API", "Tests_", "(_", "Ad", "npy", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "message_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "message", "1_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "create", "\\u", "message_", "(_", "270", "24_", ",_", "data_", "=_", "{_", "'", "text", "'_", ":_", "\"", "aw", "eso", "me", " ", "1", "\"_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message", "2_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "create", "\\u", "message_", "(_", "270", "24_", ",_", "data_", "=_", "{_", "'", "text", "'_", ":_", "\"", "aw", "eso", "me", " ", "2", "\"_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "get", "\\u", "message_", "(_", "270", "24_", ",_", "message", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "messages_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "get", "\\u", "messages_", "(_", "ids_", "=_", "'%", "s", ",", " ", "%", "s", "'_", "%_", "(_", "message", "1_", "._", "id_", ",_", "message", "2_", "._", "id_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "messages_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "users", "\\u", "messages_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "messages_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "get", "\\u", "channel", "\\u", "messages_", "(_", "270", "24_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "message_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "delete", "\\u", "message_", "(_", "270", "24_", ",_", "message", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "message_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "delete", "\\u", "message_", "(_", "270", "24_", ",_", "message", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ad", "npy", "API", "Tests_", "(_", "Ad", "npy", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "stream", "\\u", "filters_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Reset_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "stream", "\\u", "filters_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "delete", "\\u", "all", "\\u", "filters_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "filter", "\\u", "def_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "clause", "s", "\"_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "field", "\"_", ":_", "\"/", "data", "/", "entit", "ies", "/", "hashtag", "s", "/*", "/", "name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "object\\u", "type", "\"_", ":_", "\"", "post", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "opera", "tor", "\"_", ":_", "\"", "matche", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "value", "\"_", ":_", "\"", "rollout", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "id", "\"_", ":_", "\"", "1", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "match", "\\u", "policy", "\"_", ":_", "\"", "include", "\\u", "any", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "name", "\"_", ":_", "\"", "Posts", " ", "abo", "ut", " ", "rollout", "s", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stream", "\\u", "filter_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "create", "\\u", "filter_", "(_", "data_", "=_", "filter", "\\u", "def_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream", "\\u", "filter_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "get", "\\u", "filter_", "(_", "stream", "\\u", "filter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filter", "\\u", "def_", "[_", "'", "clause", "s", "'_", "]_", "+=_", "[_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "field", "\"_", ":_", "\"/", "data", "/", "entit", "ies", "/", "hashtag", "s", "/*", "/", "name", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "object\\u", "type", "\"_", ":_", "\"", "post", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "opera", "tor", "\"_", ":_", "\"", "matche", "s", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "value", "\"_", ":_", "\"", "bug", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stream", "\\u", "filter_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "update", "\\u", "filter_", "(_", "stream", "\\u", "filter_", ",_", "data_", "=_", "filter", "\\u", "def_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "stream", "\\u", "filter_", "._", "clauses_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream", "\\u", "filter_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "delete", "\\u", "filter_", "(_", "stream", "\\u", "filter_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream", "\\u", "filter_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "create", "\\u", "filter_", "(_", "data_", "=_", "filter", "\\u", "def_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "filter", "\\u", "def_", "[_", "'", "id", "'_", "]_", "=_", "'", "2", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream", "\\u", "filter_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "create", "\\u", "filter_", "(_", "data_", "=_", "filter", "\\u", "def_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream", "\\u", "filters_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "get", "\\u", "filters_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "stream", "\\u", "filters_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream", "\\u", "filters_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "delete", "\\u", "all", "\\u", "filters_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream", "\\u", "filters_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "get", "\\u", "filters_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "stream", "\\u", "filters_", ")_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Ad", "npy", "API", "Tests_", "(_", "Ad", "npy", "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", "stream_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "app", "\\u", "access", "\\u", "token_", ",_", "token_", "=_", "get", "\\u", "app", "\\u", "access", "\\u", "token_", "(_", "self_", "._", "client", "\\u", "id_", ",_", "self_", "._", "client", "\\u", "secret_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "api_", "._", "add", "\\u", "authoriz", "ation", "\\u", "token_", "(_", "app", "\\u", "access", "\\u", "token_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Reset_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "api_", "._", "delete", "\\u", "all", "\\u", "streams_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stream", "\\u", "def_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "object\\u", "types", "\"_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "post", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "long", "\\u", "poll", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "key", "\"_", ":_", "\"", "rollout", "\\u", "stream", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "app", "\\u", "stream_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "create", "\\u", "stream_", "(_", "data_", "=_", "stream", "\\u", "def_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app", "\\u", "stream_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "get", "\\u", "stream_", "(_", "app", "\\u", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "stream", "\\u", "def_", "[_", "'", "object\\u", "types", "'_", "]_", "+=_", "[_", "\"", "star", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "app", "\\u", "stream_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "update", "\\u", "stream_", "(_", "app", "\\u", "stream_", ",_", "data_", "=_", "stream", "\\u", "def_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "app", "\\u", "stream_", "._", "object\\u", "types_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app", "\\u", "stream_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "delete", "\\u", "stream_", "(_", "app", "\\u", "stream_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app", "\\u", "stream_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "create", "\\u", "stream_", "(_", "data_", "=_", "stream", "\\u", "def_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "stream", "\\u", "def_", "[_", "'", "key", "'_", "]_", "=_", "\"", "rollout", "\\u", "stream", "\\u", "2", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app", "\\u", "stream_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "create", "\\u", "stream_", "(_", "data_", "=_", "stream", "\\u", "def_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app", "\\u", "streams_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "get", "\\u", "streams_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "app", "\\u", "streams_", ")_", ",_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app", "\\u", "streams_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "delete", "\\u", "all", "\\u", "streams_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app", "\\u", "streams_", ",_", "meta_", "=_", "self_", "._", "api_", "._", "get", "\\u", "streams_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "len_", "(_", "app", "\\u", "streams_", ")_", ",_", "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, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 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, 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, 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 ]
Except block handles 'BaseException'
sccn/SNAP/src/framework/basicstimuli.py
[ { "content": " def movie(self,\n filename, # the video file to play (preferably a relative path)\n block=False, # optionally wait until the movie has finished playing before returning from this function \n # optional parameters:\n pos=None, # the (x,z) or (x,y,z) position of the video on the screen; this may be a 3-tuple of floats; y should be zero\n hpr=None, # the (heading,pitch,roll) angles of the video; if this is a single number, it will be taken as the roll angle\n scale=None, # scaling of the video area; this may be a single float, an (x,z) value, or an (x,y,z) value; note that one of \n # the scale axes is shrunken according to the value of the \"aspect\" property (which is auto-deduced unless manually overridden)\n color=None, # the (r,g,b,a) coloring of the video\n parent=None, # parent rendering context or Panda3d NodePath\n volume=0.1, # the volume of the sound (between 0 and 1)\n direction=0.0, # the balance; may be a number between -1 (hard left) and 1 (hard right)\n timeoffset=0.0, # time offset into the file\n playrate=1.0, # the playback rate of the movie (changes pitch & duration)\n looping=False, # whether the video should be looping; can be turned off by calling .stop() on the return value of this function \n loopcount=None, # optionally the number of repeats if looping\n aspect=None, # aspect ratio of the video (auto-deduced if None); example: for 16:9 this would be 16.0/9.0 \n # the smaller axis of the video area is automatically shrunken based on this number\n pixelscale=False, # if this is True, aspect will be ignored and the image will be scaled according to the pixels in the image\n # for this you need to pass as parent a randerer that uses a pixel coordinate system (such as pixel2d)\n contentoffset=(0,0), # [u,v] offset of the movie content within the viewport/texture\n contentscale=None, # [u,v] scale of the movie content within the viewport/texture -- if None this is automatically deduced based on the\n # texture size and the size of the video content within the texture (note that it can be tricky to get this right due \n # to possible padding introduced when the movie is loaded)\n bordercolor=(0,0,0,0), # the border color of the movie texture (only visible when the contentoffset and contentscale are used\n ):\n \"\"\"Play a movie. Note: Sound for movies only works with OpenAL (rather than FMOD) -- see documentation at http://www.panda3d.org/manual/index.php/Sound on how to select it.\"\"\"\n\n # load the sound track if there is one\n try:\n snd = self._engine.base.loader.loadSfx(filename)\n if snd.length() == 0.0:\n snd = None\n except:\n snd = None\n # ... and set basic sound properties\n if snd is not None:\n self._to_destroy.append(snd)\n snd.setVolume(volume)\n snd.setBalance(direction)\n\n # create the video texture and set basic properties\n tex = self._engine.base.loader.loadTexture(filename)\n self._to_destroy.append(tex)\n tex.setBorderColor((bordercolor[0],bordercolor[1],bordercolor[2],bordercolor[3]))\n tex.setWrapU(self._engine.pandac.Texture.WMBorderColor)\n tex.setWrapV(self._engine.pandac.Texture.WMBorderColor)\n if snd is not None:\n tex.synchronizeTo(snd)\n\n # apply custom playback options and deduce the actual length\n if snd is not None:\n length = snd.length()\n playable = snd\n else:\n length = tex.getTime()\n playable = tex\n if playrate != 1.0:\n playable.setPlayRate(playrate)\n length /= playrate\n if loopcount is not None:\n playable.setLoopCount(loopcount)\n length = length*loopcount\n playable.setLoop(looping)\n if looping:\n length = 10000000\n if timeoffset > 0.0:\n playable.setTime(timeoffset)\n length -= timeoffset\n\n # deduce the aspect ratio\n if aspect is None:\n aspect = tex.getVideoWidth() / float(tex.getVideoHeight())\n # deduce the content scale based on the padding in the video \n if contentscale is None:\n contentscale = (float(tex.getVideoWidth()) / tex.getXSize(), float(tex.getVideoHeight()) / tex.getYSize())\n # deduce the scale of the image\n if scale is None:\n scale = 1.0\n if type(scale) in (int,float):\n scale = [scale,scale]\n if len(scale) == 2:\n scale = (scale[0],1,scale[1])\n if pixelscale or parent == pixel2d:\n scale[0] *= tex.getVideoWidth()\n scale[2] *= tex.getVideoHeight()\n else:\n if aspect >= 1.0:\n scale[2] /= float(aspect)\n else:\n scale[0] *= float(aspect)\n \n # deduce position and rotation\n if pos is not None and type(pos) not in (int,float) and len(pos) == 2:\n pos = (pos[0],0,pos[1])\n if hpr is not None and type(scale) not in (int,float) and len(hpr) == 1:\n hpr = (0,0,hpr)\n \n # create the image and set up content parameters\n img = self._engine.direct.gui.OnscreenImage.OnscreenImage(image=tex,pos=pos,hpr=hpr,scale=scale,color=color,parent=parent)\n self._to_destroy.append(img)\n img.setTransparency(self._engine.pandac.TransparencyAttrib.MAlpha)\n img.setTexScale(self._engine.pandac.TextureStage.getDefault(),contentscale[0],contentscale[1])\n img.setTexOffset(self._engine.pandac.TextureStage.getDefault(),contentoffset[0],contentoffset[1])\n\n # start playback and assure its destruction\n playable.play()\n if self.implicit_markers:\n self.marker(244) \n if block:\n self.sleep(length)\n self._destroy_object(img, 245)\n else:\n self._engine.base.taskMgr.doMethodLater(length, self._destroy_object, 'ConvenienceFunctions, remove_movie', extraArgs=[[img,tex,snd],245])\n return playable", "metadata": "root.BasicStimuli.movie", "header": "['class', 'BasicStimuli', ':', '___EOS___']", "index": 305 }, { "content": " def precache_movie(self,filename):\n \"\"\"Pre-cache a movie file.\"\"\"\n if filename is None:\n return\n try:\n self._engine.base.loader.loadTexture(filename)\n except:\n pass\n try:\n return self._engine.base.loader.loadSfx(filename)\n except:\n pass", "metadata": "root.BasicStimuli.precache_movie", "header": "['class', 'BasicStimuli', ':', '___EOS___']", "index": 440 }, { "content": " def uncache_movie(self,filename):\n \"\"\"Un-cache a previously cached movie file.\"\"\"\n if filename is None:\n return\n try:\n h = self._engine.base.loader.loadTexture(filename)\n self._engine.base.loader.unloadTexture(h)\n except:\n pass\n try:\n h = self._engine.base.loader.loadSfx(filename)\n self._engine.base.loader.unloadSfx(h)\n except:\n pass", "metadata": "root.BasicStimuli.uncache_movie", "header": "['class', 'BasicStimuli', ':', '___EOS___']", "index": 471 }, { "content": " def _destroy_object(self,obj,id=-1):\n \"\"\"Internal helper to automatically destroy a stimulus object.\"\"\"\n try:\n if id > 0 and self.implicit_markers:\n self.marker(id)\n if not (type(obj) == list or type(obj) == tuple):\n obj = [obj]\n \n for o in obj:\n if o is not None:\n if hasattr(o,'destroy'):\n o.destroy()\n elif hasattr(o,'stop'):\n o.stop()\n else:\n del o\n # remove from cancel list\n self._to_destroy.remove(o)\n except:\n pass", "metadata": "root.BasicStimuli._destroy_object", "header": "['class', 'BasicStimuli', ':', '___EOS___']", "index": 513 } ]
[ { "span": "except:", "start_line": 338, "start_column": 8, "end_line": 338, "end_column": 15 }, { "span": "except:", "start_line": 446, "start_column": 8, "end_line": 446, "end_column": 15 }, { "span": "except:", "start_line": 450, "start_column": 8, "end_line": 450, "end_column": 15 }, { "span": "except:", "start_line": 478, "start_column": 8, "end_line": 478, "end_column": 15 }, { "span": "except:", "start_line": 483, "start_column": 8, "end_line": 483, "end_column": 15 }, { "span": "except:", "start_line": 531, "start_column": 8, "end_line": 531, "end_column": 15 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Basic", "Stim", "uli", "_", ":_", "\\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_", "movie_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "filename_", ",_", "#", " ", "the", " ", "video", " ", "file", " ", "to", " ", "play", " ", "(", "prefer", "abl", "y", " ", "a", " ", "relative", " ", "path", ")_", "\\u\\u\\uNL\\u\\u\\u_", "block_", "=_", "False_", ",_", "#", " ", "option", "ally", " ", "wait", " ", "unti", "l", " ", "the", " ", "movie", " ", "has", " ", "finish", "ed", " ", "play", "ing", " ", "bef", "ore", " ", "return", "ing", " ", "from", " ", "this", " ", "function", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "option", "al", " ", "parameter", "s", ":_", "\\u\\u\\uNL\\u\\u\\u_", "pos_", "=_", "None_", ",_", "#", " ", "the", " ", "(", "x", ",", "z", ")", " ", "or", " ", "(", "x", ",", "y", ",", "z", ")", " ", "position", " ", "of", " ", "the", " ", "video", " ", "on", " ", "the", " ", "screen", ";", " ", "this", " ", "may", " ", "be", " ", "a", " ", "3", "-", "tuple", " ", "of", " ", "float", "s", ";", " ", "y", " ", "shou", "ld", " ", "be", " ", "zero_", "\\u\\u\\uNL\\u\\u\\u_", "hpr", "_", "=_", "None_", ",_", "#", " ", "the", " ", "(", "heading", ",", "pitch", ",", "roll", ")", " ", "angle", "s", " ", "of", " ", "the", " ", "video", ";", " ", "if", " ", "this", " ", "is", " ", "a", " ", "single", " ", "number", ",", " ", "it", " ", "will", " ", "be", " ", "take", "n", " ", "as", " ", "the", " ", "roll", " ", "angle_", "\\u\\u\\uNL\\u\\u\\u_", "scale_", "=_", "None_", ",_", "#", " ", "scal", "ing", " ", "of", " ", "the", " ", "video", " ", "area", ";", " ", "this", " ", "may", " ", "be", " ", "a", " ", "single", " ", "float", ",", " ", "an", " ", "(", "x", ",", "z", ")", " ", "value", ",", " ", "or", " ", "an", " ", "(", "x", ",", "y", ",", "z", ")", " ", "value", ";", " ", "note", " ", "tha", "t", " ", "one", " ", "of", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "scale", " ", "axes", " ", "is", " ", "shr", "unk", "en", " ", "according", " ", "to", " ", "the", " ", "value", " ", "of", " ", "the", " ", "\"", "aspect", "\"", " ", "property", " ", "(", "whi", "ch", " ", "is", " ", "auto", "-", "deduc", "ed", " ", "unl", "ess", " ", "manu", "ally", " ", "overrid", "den", ")_", "\\u\\u\\uNL\\u\\u\\u_", "color_", "=_", "None_", ",_", "#", " ", "the", " ", "(", "r", ",", "g", ",", "b", ",", "a", ")", " ", "colori", "ng", " ", "of", " ", "the", " ", "video_", "\\u\\u\\uNL\\u\\u\\u_", "parent_", "=_", "None_", ",_", "#", " ", "parent", " ", "render", "ing", " ", "context", " ", "or", " ", "Pan", "da", "3d", " ", "Node", "Path_", "\\u\\u\\uNL\\u\\u\\u_", "volume_", "=_", "0.1_", ",_", "#", " ", "the", " ", "volume", " ", "of", " ", "the", " ", "sound", " ", "(", "bet", "ween", " ", "0", " ", "and", " ", "1", ")_", "\\u\\u\\uNL\\u\\u\\u_", "direction_", "=_", "0.0_", ",_", "#", " ", "the", " ", "balance", ";", " ", "may", " ", "be", " ", "a", " ", "number", " ", "bet", "ween", " ", "-1", " ", "(", "hard", " ", "left", ")", " ", "and", " ", "1", " ", "(", "hard", " ", "right", ")_", "\\u\\u\\uNL\\u\\u\\u_", "timeo", "ffset", "_", "=_", "0.0_", ",_", "#", " ", "time", " ", "offset", " ", "int", "o", " ", "the", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "play", "rate_", "=_", "1.0_", ",_", "#", " ", "the", " ", "playback", " ", "rate", " ", "of", " ", "the", " ", "movie", " ", "(", "change", "s", " ", "pitch", " ", "&", " ", "duration", ")_", "\\u\\u\\uNL\\u\\u\\u_", "looping", "_", "=_", "False_", ",_", "#", " ", "whe", "ther", " ", "the", " ", "video", " ", "shou", "ld", " ", "be", " ", "looping", ";", " ", "can", " ", "be", " ", "turn", "ed", " ", "off", " ", "by", " ", "calling", " ", ".", "stop", "()", " ", "on", " ", "the", " ", "return", " ", "value", " ", "of", " ", "this", " ", "function", " _", "\\u\\u\\uNL\\u\\u\\u_", "loop", "count_", "=_", "None_", ",_", "#", " ", "option", "ally", " ", "the", " ", "number", " ", "of", " ", "repeat", "s", " ", "if", " ", "looping", "_", "\\u\\u\\uNL\\u\\u\\u_", "aspect_", "=_", "None_", ",_", "#", " ", "aspect", " ", "ratio", " ", "of", " ", "the", " ", "video", " ", "(", "auto", "-", "deduc", "ed", " ", "if", " ", "Non", "e", ");", " ", "example", ":", " ", "for", " ", "16", ":", "9", " ", "this", " ", "wou", "ld", " ", "be", " ", "16.", "0", "/", "9.0", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "small", "er", " ", "axis", " ", "of", " ", "the", " ", "video", " ", "area", " ", "is", " ", "automati", "call", "y", " ", "shr", "unk", "en", " ", "based", " ", "on", " ", "this", " ", "number_", "\\u\\u\\uNL\\u\\u\\u_", "pixel", "scale_", "=_", "False_", ",_", "#", " ", "if", " ", "this", " ", "is", " ", "Tru", "e", ",", " ", "aspect", " ", "will", " ", "be", " ", "ignore", "d", " ", "and", " ", "the", " ", "image", " ", "will", " ", "be", " ", "scale", "d", " ", "according", " ", "to", " ", "the", " ", "pixel", "s", " ", "in", " ", "the", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "this", " ", "you", " ", "need", " ", "to", " ", "pass", " ", "as", " ", "parent", " ", "a", " ", "rand", "ere", "r", " ", "tha", "t", " ", "use", "s", " ", "a", " ", "pixel", " ", "coordinate", " ", "system", " ", "(", "suc", "h", " ", "as", " ", "pixel", "2d", ")_", "\\u\\u\\uNL\\u\\u\\u_", "content", "offset_", "=_", "(_", "0_", ",_", "0_", ")_", ",_", "#", " ", "[", "u", ",", "v", "]", " ", "offset", " ", "of", " ", "the", " ", "movie", " ", "content", " ", "within", " ", "the", " ", "viewport", "/", "texture_", "\\u\\u\\uNL\\u\\u\\u_", "content", "scale_", "=_", "None_", ",_", "#", " ", "[", "u", ",", "v", "]", " ", "scale", " ", "of", " ", "the", " ", "movie", " ", "content", " ", "within", " ", "the", " ", "viewport", "/", "textu", "re", " ", "--", " ", "if", " ", "Non", "e", " ", "this", " ", "is", " ", "automati", "call", "y", " ", "deduc", "ed", " ", "based", " ", "on", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "textu", "re", " ", "size", " ", "and", " ", "the", " ", "size", " ", "of", " ", "the", " ", "video", " ", "content", " ", "within", " ", "the", " ", "textu", "re", " ", "(", "note", " ", "tha", "t", " ", "it", " ", "can", " ", "be", " ", "trick", "y", " ", "to", " ", "get", " ", "this", " ", "right", " ", "due", " _", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "possib", "le", " ", "padd", "ing", " ", "introduce", "d", " ", "whe", "n", " ", "the", " ", "movie", " ", "is", " ", "load", "ed", ")_", "\\u\\u\\uNL\\u\\u\\u_", "border", "color_", "=_", "(_", "0_", ",_", "0_", ",_", "0_", ",_", "0_", ")_", ",_", "#", " ", "the", " ", "border", " ", "color", " ", "of", " ", "the", " ", "movie", " ", "textu", "re", " ", "(", "only", " ", "visi", "ble", " ", "whe", "n", " ", "the", " ", "content", "offset", " ", "and", " ", "content", "scale", " ", "are", " ", "used_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Play", " ", "a", " ", "movie", ".", " ", "Not", "e", ":", " ", "Sound", " ", "for", " ", "movie", "s", " ", "only", " ", "works", " ", "with", " ", "Open", "AL", " ", "(", "rat", "her", " ", "than", " ", "FM", "OD", ")", " ", "--", " ", "see", " ", "documentation", " ", "at", " ", "http", "://", "www", ".", "panda", "3d", ".", "org", "/", "manu", "al", "/", "index", ".", "php", "/", "Sound", " ", "on", " ", "how", " ", "to", " ", "select", " ", "it", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "load", " ", "the", " ", "sound", " ", "track", " ", "if", " ", "there", " ", "is", " ", "one_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "snd", "_", "=_", "self_", "._", "\\u", "engine_", "._", "base_", "._", "loader_", "._", "load", "Sf", "x_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "snd", "_", "._", "length_", "(_", ")_", "==_", "0.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "snd", "_", "=_", "None_", "\\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 ", " _", "snd", "_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "...", " ", "and", " ", "set", " ", "basic", " ", "sound", " ", "properties_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "snd", "_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "to", "\\u", "destroy_", "._", "append_", "(_", "snd", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "snd", "_", "._", "set", "Volume_", "(_", "volume_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "snd", "_", "._", "set", "Balance", "_", "(_", "direction_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "the", " ", "video", " ", "textu", "re", " ", "and", " ", "set", " ", "basic", " ", "properties_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "tex_", "=_", "self_", "._", "\\u", "engine_", "._", "base_", "._", "loader_", "._", "load", "Texture_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "to", "\\u", "destroy_", "._", "append_", "(_", "tex_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tex_", "._", "set", "Border", "Color_", "(_", "(_", "border", "color_", "[_", "0_", "]_", ",_", "border", "color_", "[_", "1_", "]_", ",_", "border", "color_", "[_", "2_", "]_", ",_", "border", "color_", "[_", "3_", "]_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tex_", "._", "set", "Wra", "p", "U_", "(_", "self_", "._", "\\u", "engine_", "._", "panda", "c_", "._", "Texture_", "._", "WM", "Border", "Color_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tex_", "._", "set", "Wra", "p", "V_", "(_", "self_", "._", "\\u", "engine_", "._", "panda", "c_", "._", "Texture_", "._", "WM", "Border", "Color_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "snd", "_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "tex_", "._", "synchronize", "To_", "(_", "snd", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "appl", "y", " ", "custom", " ", "playback", " ", "options", " ", "and", " ", "deduc", "e", " ", "the", " ", "actual", " ", "length_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "snd", "_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "length_", "=_", "snd", "_", "._", "length_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "play", "able_", "=_", "snd", "_", "\\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 ", " _", "length_", "=_", "tex_", "._", "get", "Time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "play", "able_", "=_", "tex_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "play", "rate_", "!=_", "1.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "play", "able_", "._", "set", "Play", "Rate_", "(_", "play", "rate_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "/=_", "play", "rate_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "loop", "count_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "play", "able_", "._", "set", "Loop", "Count_", "(_", "loop", "count_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "=_", "length_", "*_", "loop", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "play", "able_", "._", "set", "Loop_", "(_", "looping", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "looping", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "length_", "=_", "10000000", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "timeo", "ffset", "_", ">_", "0.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "play", "able_", "._", "set", "Time_", "(_", "timeo", "ffset", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "length_", "-=_", "timeo", "ffset", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "deduc", "e", " ", "the", " ", "aspect", " ", "ratio_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "aspect_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "aspect_", "=_", "tex_", "._", "get", "Vid", "eo", "Width_", "(_", ")_", "/_", "float_", "(_", "tex_", "._", "get", "Vid", "eo", "Height_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "deduc", "e", " ", "the", " ", "content", " ", "scale", " ", "based", " ", "on", " ", "the", " ", "padd", "ing", " ", "in", " ", "the", " ", "video", " _", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "content", "scale_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "content", "scale_", "=_", "(_", "float_", "(_", "tex_", "._", "get", "Vid", "eo", "Width_", "(_", ")_", ")_", "/_", "tex_", "._", "get", "XS", "ize_", "(_", ")_", ",_", "float_", "(_", "tex_", "._", "get", "Vid", "eo", "Height_", "(_", ")_", ")_", "/_", "tex_", "._", "get", "YS", "ize_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "deduc", "e", " ", "the", " ", "scale", " ", "of", " ", "the", " ", "image_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "scale_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scale_", "=_", "1.0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "type_", "(_", "scale_", ")_", "in_", "(_", "int_", ",_", "float_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scale_", "=_", "[_", "scale_", ",_", "scale_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "scale_", ")_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scale_", "=_", "(_", "scale_", "[_", "0_", "]_", ",_", "1_", ",_", "scale_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "pixel", "scale_", "or_", "parent_", "==_", "pixel", "2d_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scale_", "[_", "0_", "]_", "*=_", "tex_", "._", "get", "Vid", "eo", "Width_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "scale_", "[_", "2_", "]_", "*=_", "tex_", "._", "get", "Vid", "eo", "Height_", "(_", ")_", "\\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_", "aspect_", ">=_", "1.0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "scale_", "[_", "2_", "]_", "/=_", "float_", "(_", "aspect_", ")_", "\\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 ", " _", "scale_", "[_", "0_", "]_", "*=_", "float_", "(_", "aspect_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "deduc", "e", " ", "position", " ", "and", " ", "rotation_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "pos_", "is_", "not_", "None_", "and_", "type_", "(_", "pos_", ")_", "not_", "in_", "(_", "int_", ",_", "float_", ")_", "and_", "len_", "(_", "pos_", ")_", "==_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pos_", "=_", "(_", "pos_", "[_", "0_", "]_", ",_", "0_", ",_", "pos_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "hpr", "_", "is_", "not_", "None_", "and_", "type_", "(_", "scale_", ")_", "not_", "in_", "(_", "int_", ",_", "float_", ")_", "and_", "len_", "(_", "hpr", "_", ")_", "==_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "hpr", "_", "=_", "(_", "0_", ",_", "0_", ",_", "hpr", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "create", " ", "the", " ", "image", " ", "and", " ", "set", " ", "up", " ", "content", " ", "parameters_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "img_", "=_", "self_", "._", "\\u", "engine_", "._", "direct_", "._", "gui_", "._", "On", "screen", "Image_", "._", "On", "screen", "Image_", "(_", "image_", "=_", "tex_", ",_", "pos_", "=_", "pos_", ",_", "hpr", "_", "=_", "hpr", "_", ",_", "scale_", "=_", "scale_", ",_", "color_", "=_", "color_", ",_", "parent_", "=_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "to", "\\u", "destroy_", "._", "append_", "(_", "img_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "._", "set", "Transparen", "cy_", "(_", "self_", "._", "\\u", "engine_", "._", "panda", "c_", "._", "Transparen", "cy", "Attrib", "_", "._", "MA", "lph", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "._", "set", "Tex", "Scale_", "(_", "self_", "._", "\\u", "engine_", "._", "panda", "c_", "._", "Text", "ure", "Stage_", "._", "get", "Default_", "(_", ")_", ",_", "content", "scale_", "[_", "0_", "]_", ",_", "content", "scale_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "img_", "._", "set", "Tex", "Offset_", "(_", "self_", "._", "\\u", "engine_", "._", "panda", "c_", "._", "Text", "ure", "Stage_", "._", "get", "Default_", "(_", ")_", ",_", "content", "offset_", "[_", "0_", "]_", ",_", "content", "offset_", "[_", "1_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "start", " ", "playback", " ", "and", " ", "ass", "ure", " ", "its", " ", "destruct", "ion_", "\\u\\u\\uNL\\u\\u\\u_", "play", "able_", "._", "play_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "implicit", "\\u", "markers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "marker_", "(_", "244_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "block_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "sleep_", "(_", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "destroy", "\\u", "object_", "(_", "img_", ",_", "245_", ")_", "\\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", "engine_", "._", "base_", "._", "task", "Mgr_", "._", "do", "Meth", "od", "Later_", "(_", "length_", ",_", "self_", "._", "\\u", "destroy", "\\u", "object_", ",_", "'", "Conve", "nie", "nce", "Function", "s", ",", " ", "remove", "\\u", "movie", "'_", ",_", "extra", "Args_", "=_", "[_", "[_", "img_", ",_", "tex_", ",_", "snd", "_", "]_", ",_", "245_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "play", "able_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Basic", "Stim", "uli", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "prec", "ache", "\\u", "movie_", "(_", "self_", ",_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Pre", "-", "cache", " ", "a", " ", "movie", " ", "file", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "filename_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "\\u", "engine_", "._", "base_", "._", "loader_", "._", "load", "Texture_", "(_", "filename_", ")_", "\\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 ", " _", "return_", "self_", "._", "\\u", "engine_", "._", "base_", "._", "loader_", "._", "load", "Sf", "x_", "(_", "filename_", ")_", "\\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_", "Basic", "Stim", "uli", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "unca", "che", "\\u", "movie_", "(_", "self_", ",_", "filename_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Un", "-", "cache", " ", "a", " ", "previ", "ously", " ", "cache", "d", " ", "movie", " ", "file", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "filename_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "h_", "=_", "self_", "._", "\\u", "engine_", "._", "base_", "._", "loader_", "._", "load", "Texture_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "engine_", "._", "base_", "._", "loader_", "._", "unload", "Texture_", "(_", "h_", ")_", "\\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 ", " _", "h_", "=_", "self_", "._", "\\u", "engine_", "._", "base_", "._", "loader_", "._", "load", "Sf", "x_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "\\u", "engine_", "._", "base_", "._", "loader_", "._", "unload", "Sf", "x_", "(_", "h_", ")_", "\\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_", "Basic", "Stim", "uli", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "destroy", "\\u", "object_", "(_", "self_", ",_", "obj_", ",_", "id_", "=_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "Intern", "al", " ", "help", "er", " ", "to", " ", "automati", "call", "y", " ", "destroy", " ", "a", " ", "stimulus", " ", "object", ".\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "id_", ">_", "0_", "and_", "self_", "._", "implicit", "\\u", "markers_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "marker_", "(_", "id_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "(_", "type_", "(_", "obj_", ")_", "==_", "list_", "or_", "type_", "(_", "obj_", ")_", "==_", "tuple_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "obj_", "=_", "[_", "obj_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "o_", "in_", "obj_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "o_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "hasattr_", "(_", "o_", ",_", "'", "destroy", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "o_", "._", "destroy_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "hasattr_", "(_", "o_", ",_", "'", "stop", "'_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "o_", "._", "stop_", "(_", ")_", "\\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 ", " ", " _", "del_", "o_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "remove", " ", "from", " ", "cancel", " ", "list_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "\\u", "to", "\\u", "destroy_", "._", "remove_", "(_", "o_", ")_", "\\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_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_" ]
[ 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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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, 0, 1, 1, 1, 1, 2, 2, 2, 2 ]
Unused local variable
jgehrcke/timegaps/utils/profile_filter_func.py
[ { "content": "def main():\n t0 = time.time()\n now = time.time()\n fses = list(fsegen(ref=now, N_per_cat=5*10**4, max_timecount=9))\n shuffle(fses)\n nbr_fses = len(fses)\n n = 8\n rules = {\n \"years\": n,\n \"months\": n,\n \"weeks\": n,\n \"days\": n,\n \"hours\": n,\n \"recent\": n\n }\n sduration = time.time() - t0\n log.info(\"Setup duration: %.3f s\", sduration)\n log.info(\"Profiling...\")\n pr = cProfile.Profile()\n pr.enable()\n a, r = TimeFilter(rules, now).filter(fses)\n pr.disable()\n s = StringIO.StringIO()\n ps = pstats.Stats(pr, stream=s).sort_stats('time')\n ps.print_stats(20)\n print s.getvalue()", "metadata": "root.main", "header": "['module', '___EOS___']", "index": 21 } ]
[ { "span": "nbr_fses ", "start_line": 26, "start_column": 4, "end_line": 26, "end_column": 12 }, { "span": "a,", "start_line": 41, "start_column": 4, "end_line": 41, "end_column": 5 }, { "span": "r ", "start_line": 41, "start_column": 7, "end_line": 41, "end_column": 8 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[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 ", " _", "t0_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "now_", "=_", "time_", "._", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fse", "s_", "=_", "list_", "(_", "fse", "gen_", "(_", "ref_", "=_", "now_", ",_", "N", "\\u", "per", "\\u", "cat_", "=_", "5_", "*_", "10_", "**_", "4_", ",_", "max", "\\u", "timeco", "unt_", "=_", "9_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "shuffle_", "(_", "fse", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "nbr", "\\u", "fse", "s_", "=_", "len_", "(_", "fse", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "n_", "=_", "8_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rules_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "year", "s", "\"_", ":_", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "month", "s", "\"_", ":_", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "week", "s", "\"_", ":_", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "day", "s", "\"_", ":_", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "hour", "s", "\"_", ":_", "n_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "recent", "\"_", ":_", "n_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sd", "ura", "tion_", "=_", "time_", "._", "time_", "(_", ")_", "-_", "t0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "Set", "up", " ", "duration", ":", " ", "%", ".3", "f", " ", "s", "\"_", ",_", "sd", "ura", "tion_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "log_", "._", "info_", "(_", "\"", "Profil", "ing", "...\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pr_", "=_", "c", "Profile_", "._", "Profile_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pr_", "._", "enable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "a_", ",_", "r_", "=_", "Time", "Filter_", "(_", "rules_", ",_", "now_", ")_", "._", "filter_", "(_", "fse", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pr_", "._", "disable_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "s_", "=_", "String", "IO_", "._", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ps_", "=_", "pstat", "s_", "._", "Stats_", "(_", "pr_", ",_", "stream_", "=_", "s_", ")_", "._", "sort", "\\u", "stats_", "(_", "'", "time", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ps_", "._", "print", "\\u", "stats_", "(_", "20_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "s_", "._", "getvalue_", "(_", ")_", "\\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, 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, 0, 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 ]
Unused local variable
CybOXProject/python-cybox/cybox/bindings/win_kernel_object.py
[ { "content": " def exportChildren(self, lwrite, level, namespace_='WinKernelObj:', name_='SSDTEntryListType', fromsubclass_=False, pretty_print=True):\n if pretty_print:\n eol_ = '\\n'\n else:\n eol_ = ''\n for SSDT_Entry_ in self.SSDT_Entry:\n SSDT_Entry_.export(lwrite, level, 'WinKernelObj:', name_='SSDT_Entry', pretty_print=pretty_print)", "metadata": "root.SSDTEntryListType.exportChildren", "header": "['class', 'SSDTEntryListType', '(', 'GeneratedsSuper', ')', ':', '___EOS___']", "index": 55 }, { "content": " def exportChildren(self, lwrite, level, namespace_='WinKernelObj:', name_='SSDTEntryType', fromsubclass_=False, pretty_print=True):\n if pretty_print:\n eol_ = '\\n'\n else:\n eol_ = ''\n if self.Service_Table_Base is not None:\n self.Service_Table_Base.export(lwrite, level, 'WinKernelObj:', name_='Service_Table_Base', pretty_print=pretty_print)\n if self.Service_Counter_Table_Base is not None:\n self.Service_Counter_Table_Base.export(lwrite, level, 'WinKernelObj:', name_='Service_Counter_Table_Base', pretty_print=pretty_print)\n if self.Number_Of_Services is not None:\n self.Number_Of_Services.export(lwrite, level, 'WinKernelObj:', name_='Number_Of_Services', pretty_print=pretty_print)\n if self.Argument_Table_Base is not None:\n self.Argument_Table_Base.export(lwrite, level, 'WinKernelObj:', name_='Argument_Table_Base', pretty_print=pretty_print)", "metadata": "root.SSDTEntryType.exportChildren", "header": "['class', 'SSDTEntryType', '(', 'GeneratedsSuper', ')', ':', '___EOS___']", "index": 142 }, { "content": " def exportChildren(self, lwrite, level, namespace_='WinKernelObj:', name_='IDTEntryListType', fromsubclass_=False, pretty_print=True):\n if pretty_print:\n eol_ = '\\n'\n else:\n eol_ = ''\n for IDT_Entry_ in self.IDT_Entry:\n IDT_Entry_.export(lwrite, level, 'WinKernelObj:', name_='IDT_Entry', pretty_print=pretty_print)", "metadata": "root.IDTEntryListType.exportChildren", "header": "['class', 'IDTEntryListType', '(', 'GeneratedsSuper', ')', ':', '___EOS___']", "index": 239 }, { "content": " def exportChildren(self, lwrite, level, namespace_='WinKernelObj:', name_='IDTEntryType', fromsubclass_=False, pretty_print=True):\n if pretty_print:\n eol_ = '\\n'\n else:\n eol_ = ''\n if self.Type_Attr is not None:\n self.Type_Attr.export(lwrite, level, 'WinKernelObj:', name_='Type_Attr', pretty_print=pretty_print)\n if self.Offset_High is not None:\n self.Offset_High.export(lwrite, level, 'WinKernelObj:', name_='Offset_High', pretty_print=pretty_print)\n if self.Offset_Low is not None:\n self.Offset_Low.export(lwrite, level, 'WinKernelObj:', name_='Offset_Low', pretty_print=pretty_print)\n if self.Offset_Middle is not None:\n self.Offset_Middle.export(lwrite, level, 'WinKernelObj:', name_='Offset_Middle', pretty_print=pretty_print)\n if self.Selector is not None:\n self.Selector.export(lwrite, level, 'WinKernelObj:', name_='Selector', pretty_print=pretty_print)", "metadata": "root.IDTEntryType.exportChildren", "header": "['class', 'IDTEntryType', '(', 'GeneratedsSuper', ')', ':', '___EOS___']", "index": 322 }, { "content": " def exportChildren(self, lwrite, level, namespace_='WinKernelObj:', name_='WindowsKernelObjectType', fromsubclass_=False, pretty_print=True):\n super(WindowsKernelObjectType, self).exportChildren(lwrite, level, 'WinKernelObj:', name_, True, pretty_print=pretty_print)\n if pretty_print:\n eol_ = '\\n'\n else:\n eol_ = ''\n if self.IDT is not None:\n self.IDT.export(lwrite, level, 'WinKernelObj:', name_='IDT', pretty_print=pretty_print)\n if self.SSDT is not None:\n self.SSDT.export(lwrite, level, 'WinKernelObj:', name_='SSDT', pretty_print=pretty_print)", "metadata": "root.WindowsKernelObjectType.exportChildren", "header": "['class', 'WindowsKernelObjectType', '(', 'cybox_common', '.', 'ObjectPropertiesType', ')', ':', '___EOS___']", "index": 415 }, { "content": "def parse(inFileName):\n doc = parsexml_(inFileName)\n rootNode = doc.getroot()\n rootTag, rootClass = get_root_tag(rootNode)\n if rootClass is None:\n rootTag = 'Windows_Kernel'\n rootClass = WindowsKernelObjectType\n rootObj = rootClass.factory()\n rootObj.build(rootNode)\n # Enable Python to collect the space used by the DOM.\n doc = None\n# sys.stdout.write('<?xml version=\"1.0\" ?>\\n')\n# rootObj.export(sys.stdout.write, 0, name_=rootTag,\n# namespacedef_='',\n# pretty_print=True)\n return rootObj", "metadata": "root.parse", "header": "['module', '___EOS___']", "index": 562 }, { "content": "def parseEtree(inFileName):\n doc = parsexml_(inFileName)\n rootNode = doc.getroot()\n rootTag, rootClass = get_root_tag(rootNode)\n if rootClass is None:\n rootTag = 'Windows_Kernel'\n rootClass = WindowsKernelObjectType\n rootObj = rootClass.factory()\n rootObj.build(rootNode)\n # Enable Python to collect the space used by the DOM.\n doc = None\n rootElement = rootObj.to_etree(None, name_=rootTag)\n content = etree_.tostring(rootElement, pretty_print=True,\n xml_declaration=True, encoding=\"utf-8\")\n sys.stdout.write(content)\n sys.stdout.write('\\n')\n return rootObj, rootElement", "metadata": "root.parseEtree", "header": "['module', '___EOS___']", "index": 579 }, { "content": "def parseString(inString):\n from mixbox.vendor.six import StringIO\n doc = parsexml_(StringIO(inString))\n rootNode = doc.getroot()\n rootTag, rootClass = get_root_tag(rootNode)\n if rootClass is None:\n rootTag = 'Windows_Kernel'\n rootClass = WindowsKernelObjectType\n rootObj = rootClass.factory()\n rootObj.build(rootNode)\n # Enable Python to collect the space used by the DOM.\n doc = None\n# sys.stdout.write('<?xml version=\"1.0\" ?>\\n')\n# rootObj.export(sys.stdout.write, 0, name_=\"Windows_Kernel\",\n# namespacedef_='')\n return rootObj", "metadata": "root.parseString", "header": "['module', '___EOS___']", "index": 597 } ]
[ { "span": "eol_ ", "start_line": 57, "start_column": 12, "end_line": 57, "end_column": 16 }, { "span": "eol_ ", "start_line": 59, "start_column": 12, "end_line": 59, "end_column": 16 }, { "span": "eol_ ", "start_line": 144, "start_column": 12, "end_line": 144, "end_column": 16 }, { "span": "eol_ ", "start_line": 146, "start_column": 12, "end_line": 146, "end_column": 16 }, { "span": "eol_ ", "start_line": 241, "start_column": 12, "end_line": 241, "end_column": 16 }, { "span": "eol_ ", "start_line": 243, "start_column": 12, "end_line": 243, "end_column": 16 }, { "span": "eol_ ", "start_line": 324, "start_column": 12, "end_line": 324, "end_column": 16 }, { "span": "eol_ ", "start_line": 326, "start_column": 12, "end_line": 326, "end_column": 16 }, { "span": "eol_ ", "start_line": 418, "start_column": 12, "end_line": 418, "end_column": 16 }, { "span": "eol_ ", "start_line": 420, "start_column": 12, "end_line": 420, "end_column": 16 }, { "span": "rootTag ", "start_line": 567, "start_column": 8, "end_line": 567, "end_column": 15 }, { "span": "doc ", "start_line": 572, "start_column": 4, "end_line": 572, "end_column": 7 }, { "span": "doc ", "start_line": 589, "start_column": 4, "end_line": 589, "end_column": 7 }, { "span": "rootTag ", "start_line": 603, "start_column": 8, "end_line": 603, "end_column": 15 }, { "span": "doc ", "start_line": 608, "start_column": 4, "end_line": 608, "end_column": 7 } ]
[]
1
true
[ "[CLS]_", "Un", "used_", "local_", "variable_", "[SEP]_", "class_", "SSD", "TE", "ntr", "y", "List", "Type_", "(_", "Generate", "ds", "Super", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "export", "Children_", "(_", "self_", ",_", "lw", "rite_", ",_", "level_", ",_", "namespace\\u_", "=_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "SSD", "TE", "ntr", "y", "List", "Type", "'_", ",_", "froms", "ubc", "lass\\u", "_", "=_", "False_", ",_", "pretty", "\\u", "print_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pretty", "\\u", "print_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eol\\u_", "=_", "'\\\\", "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 ", " _", "eol\\u_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "SSD", "T", "\\u", "Entr", "y\\u_", "in_", "self_", "._", "SSD", "T", "\\u", "Entry_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "SSD", "T", "\\u", "Entr", "y\\u_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "SSD", "T", "\\u", "Entr", "y", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SSD", "TE", "ntr", "y", "Type_", "(_", "Generate", "ds", "Super", "_", ")_", ":_", "\\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_", "export", "Children_", "(_", "self_", ",_", "lw", "rite_", ",_", "level_", ",_", "namespace\\u_", "=_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "SSD", "TE", "ntr", "y", "Type", "'_", ",_", "froms", "ubc", "lass\\u", "_", "=_", "False_", ",_", "pretty", "\\u", "print_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pretty", "\\u", "print_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eol\\u_", "=_", "'\\\\", "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 ", " _", "eol\\u_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Service", "\\u", "Table", "\\u", "Base_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Service", "\\u", "Table", "\\u", "Base_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Service", "\\u", "Table", "\\u", "Base", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Service", "\\u", "Counter", "\\u", "Table", "\\u", "Base_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Service", "\\u", "Counter", "\\u", "Table", "\\u", "Base_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Service", "\\u", "Counter", "\\u", "Table", "\\u", "Base", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Number", "\\u", "Of", "\\u", "Services_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Number", "\\u", "Of", "\\u", "Services_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Number", "\\u", "Of", "\\u", "Service", "s", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Arg", "ument", "\\u", "Table", "\\u", "Base_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Arg", "ument", "\\u", "Table", "\\u", "Base_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Arg", "ument", "\\u", "Table", "\\u", "Base", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ID", "TE", "ntr", "y", "List", "Type_", "(_", "Generate", "ds", "Super", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "export", "Children_", "(_", "self_", ",_", "lw", "rite_", ",_", "level_", ",_", "namespace\\u_", "=_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "ID", "TE", "ntr", "y", "List", "Type", "'_", ",_", "froms", "ubc", "lass\\u", "_", "=_", "False_", ",_", "pretty", "\\u", "print_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pretty", "\\u", "print_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eol\\u_", "=_", "'\\\\", "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 ", " _", "eol\\u_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "ID", "T", "\\u", "Entr", "y\\u_", "in_", "self_", "._", "ID", "T", "\\u", "Entry_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ID", "T", "\\u", "Entr", "y\\u_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "ID", "T", "\\u", "Entr", "y", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "ID", "TE", "ntr", "y", "Type_", "(_", "Generate", "ds", "Super", "_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "export", "Children_", "(_", "self_", ",_", "lw", "rite_", ",_", "level_", ",_", "namespace\\u_", "=_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "ID", "TE", "ntr", "y", "Type", "'_", ",_", "froms", "ubc", "lass\\u", "_", "=_", "False_", ",_", "pretty", "\\u", "print_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "pretty", "\\u", "print_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eol\\u_", "=_", "'\\\\", "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 ", " _", "eol\\u_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Type", "\\u", "Attr_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Type", "\\u", "Attr_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Type", "\\u", "Attr", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Off", "set\\u", "High_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Off", "set\\u", "High_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Off", "set\\u", "Hig", "h", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Off", "set\\u", "Low_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Off", "set\\u", "Low_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Off", "set\\u", "Lo", "w", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Off", "set\\u", "Mid", "dle", "_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Off", "set\\u", "Mid", "dle", "_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Off", "set\\u", "Mid", "dle", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "Selector_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "Selector_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Select", "or", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Window", "s", "Kern", "el", "Object", "Type_", "(_", "cy", "box", "\\u", "common_", "._", "Object", "Proper", "ties", "Type_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "export", "Children_", "(_", "self_", ",_", "lw", "rite_", ",_", "level_", ",_", "namespace\\u_", "=_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "Window", "s", "Kern", "el", "Object", "Type", "'_", ",_", "froms", "ubc", "lass\\u", "_", "=_", "False_", ",_", "pretty", "\\u", "print_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "super_", "(_", "Window", "s", "Kern", "el", "Object", "Type_", ",_", "self_", ")_", "._", "export", "Children_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", ",_", "True_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "pretty", "\\u", "print_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "eol\\u_", "=_", "'\\\\", "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 ", " _", "eol\\u_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "ID", "T_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "ID", "T_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "ID", "T", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "SSD", "T_", "is_", "not_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "SSD", "T_", "._", "export_", "(_", "lw", "rite_", ",_", "level_", ",_", "'", "Win", "Kern", "el", "Obj", ":'_", ",_", "name\\u_", "=_", "'", "SSD", "T", "'_", ",_", "pretty", "\\u", "print_", "=_", "pretty", "\\u", "print_", ")_", "\\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_", "parse_", "(_", "in", "File", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "parse", "xml", "\\u_", "(_", "in", "File", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Node_", "=_", "doc_", "._", "getroot_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Tag_", ",_", "root", "Class_", "=_", "get", "\\u", "root", "\\u", "tag_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "root", "Class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root", "Tag_", "=_", "'", "Window", "s", "\\u", "Kern", "el", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Class_", "=_", "Window", "s", "Kern", "el", "Object", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root", "Obj_", "=_", "root", "Class_", "._", "factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Obj_", "._", "build_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Enable", " ", "Pyth", "on", " ", "to", " ", "collect", " ", "the", " ", "space", " ", "used", " ", "by", " ", "the", " ", "DOM", "._", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "sys", ".", "stdout", ".", "write", "('", "<", "?", "xml", " ", "version", "=\"", "1.0", "\"", " ", "?>", "\\\\", "n", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "root", "Obj", ".", "export", "(", "sys", ".", "stdout", ".", "write", ",", " ", "0", ",", " ", "name", "\\u", "=", "root", "Ta", "g", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "namespace", "def", "\\u", "=''", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "pretty", "\\u", "print", "=", "Tru", "e", ")_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "root", "Obj_", "\\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_", "parse", "Et", "ree_", "(_", "in", "File", "Name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "doc_", "=_", "parse", "xml", "\\u_", "(_", "in", "File", "Name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Node_", "=_", "doc_", "._", "getroot_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Tag_", ",_", "root", "Class_", "=_", "get", "\\u", "root", "\\u", "tag_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "root", "Class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root", "Tag_", "=_", "'", "Window", "s", "\\u", "Kern", "el", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Class_", "=_", "Window", "s", "Kern", "el", "Object", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root", "Obj_", "=_", "root", "Class_", "._", "factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Obj_", "._", "build_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Enable", " ", "Pyth", "on", " ", "to", " ", "collect", " ", "the", " ", "space", " ", "used", " ", "by", " ", "the", " ", "DOM", "._", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Element_", "=_", "root", "Obj_", "._", "to", "\\u", "etree_", "(_", "None_", ",_", "name\\u_", "=_", "root", "Tag_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "content_", "=_", "etree", "\\u_", "._", "tostring_", "(_", "root", "Element_", ",_", "pretty", "\\u", "print_", "=_", "True_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "xml", "\\u", "declaration_", "=_", "True_", ",_", "encoding_", "=_", "\"", "utf", "-", "8", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "content_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "stdout_", "._", "write_", "(_", "'\\\\", "n", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "root", "Obj_", ",_", "root", "Element_", "\\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_", "parse", "String_", "(_", "in", "String_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "mix", "box_", "._", "vendor_", "._", "six_", "import_", "String", "IO_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "doc_", "=_", "parse", "xml", "\\u_", "(_", "String", "IO_", "(_", "in", "String_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Node_", "=_", "doc_", "._", "getroot_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Tag_", ",_", "root", "Class_", "=_", "get", "\\u", "root", "\\u", "tag_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "root", "Class_", "is_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "root", "Tag_", "=_", "'", "Window", "s", "\\u", "Kern", "el", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Class_", "=_", "Window", "s", "Kern", "el", "Object", "Type_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "root", "Obj_", "=_", "root", "Class_", "._", "factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "root", "Obj_", "._", "build_", "(_", "root", "Node_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Enable", " ", "Pyth", "on", " ", "to", " ", "collect", " ", "the", " ", "space", " ", "used", " ", "by", " ", "the", " ", "DOM", "._", "\\u\\u\\uNL\\u\\u\\u_", "doc_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", " ", " ", " ", "sys", ".", "stdout", ".", "write", "('", "<", "?", "xml", " ", "version", "=\"", "1.0", "\"", " ", "?>", "\\\\", "n", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "root", "Obj", ".", "export", "(", "sys", ".", "stdout", ".", "write", ",", " ", "0", ",", " ", "name", "\\u", "=\"", "Window", "s", "\\u", "Kern", "el", "\",", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "namespace", "def", "\\u", "=''", ")_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "root", "Obj_", "\\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, 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, 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, 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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 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, 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, 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 ]
Except block handles 'BaseException'
azoft-dev-team/imagrium/env/Lib/test/zxjdbc/sptest.py
[ { "content": " def setUp(self):\n zxCoreTestCase.setUp(self)\n\n c = self.cursor()\n\n try:\n try:\n c.execute(\"drop table sptest\")\n except:\n self.db.rollback()\n try:\n c.execute(\"create table sptest (x varchar2(20))\")\n c.execute(\"create or replace procedure procnone is begin insert into sptest values ('testing'); end;\")\n c.execute(\"create or replace procedure procin (y in varchar2) is begin insert into sptest values (y); end;\")\n c.execute(\"create or replace procedure procout (y out varchar2) is begin y := 'tested'; end;\")\n c.execute(\"create or replace procedure procinout (y out varchar2, z in varchar2) is begin insert into sptest values (z); y := 'tested'; end;\")\n c.execute(\"create or replace function funcnone return varchar2 is begin return 'tested'; end;\")\n c.execute(\"create or replace function funcin (y varchar2) return varchar2 is begin return y || y; end;\")\n c.execute(\"create or replace function funcout (y out varchar2) return varchar2 is begin y := 'tested'; return 'returned'; end;\")\n self.db.commit()\n except:\n self.db.rollback()\n self.fail(\"procedure creation failed\")\n\n self.proc_errors(\"PROC\")\n self.proc_errors(\"FUNC\")\n\n finally:\n c.close()", "metadata": "root.OracleSPTest.setUp", "header": "['class', 'OracleSPTest', '(', 'zxCoreTestCase', ')', ':', '___EOS___']", "index": 8 }, { "content": " def testProcWithResultSet(self):\n c = self.cursor()\n try:\n for a in ((\"table\", \"sptest\"), (\"procedure\", \"sp_proctest\")):\n try:\n c.execute(\"drop %s %s\" % (a))\n except:\n pass\n\n c.execute(\"create table sptest (a int, b varchar(32))\")\n c.execute(\"insert into sptest values (1, 'hello')\")\n c.execute(\"insert into sptest values (2, 'there')\")\n c.execute(\"insert into sptest values (3, 'goodbye')\")\n\n c.execute(\"\"\" create procedure sp_proctest (@A int) as select a, b from sptest where a <= @A \"\"\")\n self.db.commit()\n\n c.callproc(\"sp_proctest\", (2,))\n data = c.fetchall()\n self.assertEquals(2, len(data))\n self.assertEquals(2, len(c.description))\n assert c.nextset() is not None, \"expected an additional result set\"\n data = c.fetchall()\n self.assertEquals(1, len(data))\n self.assertEquals(1, len(c.description))\n finally:\n c.close()", "metadata": "root.SQLServerSPTest.testProcWithResultSet", "header": "['class', 'SQLServerSPTest', '(', 'zxCoreTestCase', ')', ':', '___EOS___']", "index": 186 } ]
[ { "span": "except:", "start_line": 16, "start_column": 12, "end_line": 16, "end_column": 19 }, { "span": "except:", "start_line": 28, "start_column": 12, "end_line": 28, "end_column": 19 }, { "span": "except:", "start_line": 192, "start_column": 16, "end_line": 192, "end_column": 23 } ]
[]
1
true
[ "[CLS]_", "Except", "_", "block_", "handles_", "'", "Base", "Except", "ion", "'_", "[SEP]_", "class_", "Ora", "cle", "SP", "Test_", "(_", "zx", "Core", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "set", "Up_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "zx", "Core", "Test", "Case_", "._", "set", "Up_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "=_", "self_", "._", "cursor_", "(_", ")_", "\\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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "._", "execute_", "(_", "\"", "drop", " ", "table", " ", "spt", "est", "\"_", ")_", "\\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_", "._", "db_", "._", "rollback_", "(_", ")_", "\\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 ", " _", "c_", "._", "execute_", "(_", "\"", "create", " ", "table", " ", "spt", "est", " ", "(", "x", " ", "var", "char", "2", "(", "20", "))\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "execute_", "(_", "\"", "create", " ", "or", " ", "replace", " ", "procedure", " ", "proc", "none", " ", "is", " ", "begin", " ", "insert", " ", "int", "o", " ", "spt", "est", " ", "values", " ", "('", "testi", "ng", "');", " ", "end", ";\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "execute_", "(_", "\"", "create", " ", "or", " ", "replace", " ", "procedure", " ", "proc", "in", " ", "(", "y", " ", "in", " ", "var", "char", "2", ")", " ", "is", " ", "begin", " ", "insert", " ", "int", "o", " ", "spt", "est", " ", "values", " ", "(", "y", ");", " ", "end", ";\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "execute_", "(_", "\"", "create", " ", "or", " ", "replace", " ", "procedure", " ", "proc", "out", " ", "(", "y", " ", "out", " ", "var", "char", "2", ")", " ", "is", " ", "begin", " ", "y", " ", ":", "=", " ", "'", "tested", "';", " ", "end", ";\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "execute_", "(_", "\"", "create", " ", "or", " ", "replace", " ", "procedure", " ", "proc", "inou", "t", " ", "(", "y", " ", "out", " ", "var", "char", "2", ",", " ", "z", " ", "in", " ", "var", "char", "2", ")", " ", "is", " ", "begin", " ", "insert", " ", "int", "o", " ", "spt", "est", " ", "values", " ", "(", "z", ");", " ", "y", " ", ":", "=", " ", "'", "tested", "';", " ", "end", ";\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "execute_", "(_", "\"", "create", " ", "or", " ", "replace", " ", "function", " ", "func", "none", " ", "return", " ", "var", "char", "2", " ", "is", " ", "begin", " ", "return", " ", "'", "tested", "';", " ", "end", ";\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "execute_", "(_", "\"", "create", " ", "or", " ", "replace", " ", "function", " ", "func", "in", " ", "(", "y", " ", "var", "char", "2", ")", " ", "return", " ", "var", "char", "2", " ", "is", " ", "begin", " ", "return", " ", "y", " ", "||", " ", "y", ";", " ", "end", ";\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "execute_", "(_", "\"", "create", " ", "or", " ", "replace", " ", "function", " ", "func", "out", " ", "(", "y", " ", "out", " ", "var", "char", "2", ")", " ", "return", " ", "var", "char", "2", " ", "is", " ", "begin", " ", "y", " ", ":", "=", " ", "'", "tested", "';", " ", "return", " ", "'", "return", "ed", "';", " ", "end", ";\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db_", "._", "commit_", "(_", ")_", "\\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_", "._", "db_", "._", "rollback_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "fail_", "(_", "\"", "procedure", " ", "creati", "on", " ", "fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "proc", "\\u", "errors_", "(_", "\"", "PROC", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "proc", "\\u", "errors_", "(_", "\"", "FUNC", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "SQL", "Server", "SP", "Test_", "(_", "zx", "Core", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "test", "Proc", "With", "Result", "Set_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "c_", "=_", "self_", "._", "cursor_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "a_", "in_", "(_", "(_", "\"", "table", "\"_", ",_", "\"", "spt", "est", "\"_", ")_", ",_", "(_", "\"", "procedure", "\"_", ",_", "\"", "sp", "\\u", "proc", "test", "\"_", ")_", ")_", ":_", "\\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 ", " ", "_", "c_", "._", "execute_", "(_", "\"", "drop", " ", "%", "s", " ", "%", "s", "\"_", "%_", "(_", "a_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "c_", "._", "execute_", "(_", "\"", "create", " ", "table", " ", "spt", "est", " ", "(", "a", " ", "int", ",", " ", "b", " ", "var", "char", "(", "32", "))\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "execute_", "(_", "\"", "insert", " ", "int", "o", " ", "spt", "est", " ", "values", " ", "(", "1", ",", " ", "'", "hell", "o", "')\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "execute_", "(_", "\"", "insert", " ", "int", "o", " ", "spt", "est", " ", "values", " ", "(", "2", ",", " ", "'", "there", "')\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "c_", "._", "execute_", "(_", "\"", "insert", " ", "int", "o", " ", "spt", "est", " ", "values", " ", "(", "3", ",", " ", "'", "good", "bye", "')\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "._", "execute_", "(_", "\"\"\"", " ", "create", " ", "procedure", " ", "sp", "\\u", "proc", "test", " ", "(", "@", "A", " ", "int", ")", " ", "as", " ", "select", " ", "a", ",", " ", "b", " ", "from", " ", "spt", "est", " ", "where", " ", "a", " ", "<=", " ", "@", "A", " ", "\"\"\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "db_", "._", "commit_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "c_", "._", "call", "proc_", "(_", "\"", "sp", "\\u", "proc", "test", "\"_", ",_", "(_", "2_", ",_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "c_", "._", "fetchall_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "2_", ",_", "len_", "(_", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "2_", ",_", "len_", "(_", "c_", "._", "description_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "c_", "._", "next", "set_", "(_", ")_", "is_", "not_", "None_", ",_", "\"", "expected", " ", "an", " ", "addition", "al", " ", "result", " ", "set", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "c_", "._", "fetchall_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "1_", ",_", "len_", "(_", "data_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equals_", "(_", "1_", ",_", "len_", "(_", "c_", "._", "description_", ")_", ")_", "\\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 ", " _", "c_", "._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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 ]
First parameter of a method is not named 'self'
robmoggach/python-moshion/moshion/extractframes/Rat.py
[ { "content": " def __add__(a, b):\n try:\n return rat(a.__num * b.__den + b.__num * a.__den,\n a.__den * b.__den)\n except OverflowError:\n return rat(long(a.__num) * long(b.__den) +\n long(b.__num) * long(a.__den),\n long(a.__den) * long(b.__den))", "metadata": "root.Rat.__add__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 106 }, { "content": " def __radd__(b, a):\n return Rat(a) + b", "metadata": "root.Rat.__radd__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 115 }, { "content": " def __sub__(a, b):\n try:\n return rat(a.__num * b.__den - b.__num * a.__den,\n a.__den * b.__den)\n except OverflowError:\n return rat(long(a.__num) * long(b.__den) -\n long(b.__num) * long(a.__den),\n long(a.__den) * long(b.__den))", "metadata": "root.Rat.__sub__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 119 }, { "content": " def __rsub__(b, a):\n return Rat(a) - b", "metadata": "root.Rat.__rsub__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 128 }, { "content": " def __mul__(a, b):\n try:\n return rat(a.__num * b.__num, a.__den * b.__den)\n except OverflowError:\n return rat(long(a.__num) * long(b.__num),\n long(a.__den) * long(b.__den))", "metadata": "root.Rat.__mul__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 132 }, { "content": " def __rmul__(b, a):\n return Rat(a) * b", "metadata": "root.Rat.__rmul__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 139 }, { "content": " def __div__(a, b):\n try:\n return rat(a.__num * b.__den, a.__den * b.__num)\n except OverflowError:\n return rat(long(a.__num) * long(b.__den),\n long(a.__den) * long(b.__num))", "metadata": "root.Rat.__div__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 143 }, { "content": " def __rdiv__(b, a):\n return Rat(a) / b", "metadata": "root.Rat.__rdiv__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 150 }, { "content": " def __mod__(a, b):\n div = a / b\n try:\n div = int(div)\n except OverflowError:\n div = long(div)\n return a - b * div", "metadata": "root.Rat.__mod__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 154 }, { "content": " def __rmod__(b, a):\n return Rat(a) % b", "metadata": "root.Rat.__rmod__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 162 }, { "content": " def __pow__(a, b):\n if b.__den != 1:\n if isinstance(a.__num, complex):\n a = complex(a)\n else:\n a = float(a)\n if isinstance(b.__num, complex):\n b = complex(b)\n else:\n b = float(b)\n return a ** b\n try:\n return rat(a.__num ** b.__num, a.__den ** b.__num)\n except OverflowError:\n return rat(long(a.__num) ** b.__num,\n long(a.__den) ** b.__num)", "metadata": "root.Rat.__pow__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 166 }, { "content": " def __rpow__(b, a):\n return Rat(a) ** b", "metadata": "root.Rat.__rpow__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 183 }, { "content": " def __neg__(a):\n try:\n return rat(-a.__num, a.__den)\n except OverflowError:\n # a.__num == sys.maxint\n return rat(-long(a.__num), a.__den)", "metadata": "root.Rat.__neg__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 187 }, { "content": " def __abs__(a):\n return rat(abs(a.__num), a.__den)", "metadata": "root.Rat.__abs__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 195 }, { "content": " def __int__(a):\n return int(a.__num / a.__den)", "metadata": "root.Rat.__int__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 199 }, { "content": " def __long__(a):\n return long(a.__num) / long(a.__den)", "metadata": "root.Rat.__long__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 203 }, { "content": " def __float__(a):\n return float(a.__num) / float(a.__den)", "metadata": "root.Rat.__float__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 207 }, { "content": " def __complex__(a):\n return complex(a.__num) / complex(a.__den)", "metadata": "root.Rat.__complex__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 211 }, { "content": " def __cmp__(a, b):\n diff = Rat(a - b)\n if diff.__num < 0:\n return -1\n elif diff.__num > 0:\n return 1\n else:\n return 0", "metadata": "root.Rat.__cmp__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 215 }, { "content": " def __rcmp__(b, a):\n return cmp(Rat(a), b)", "metadata": "root.Rat.__rcmp__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 224 }, { "content": " def __nonzero__(a):\n return a.__num != 0", "metadata": "root.Rat.__nonzero__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 228 }, { "content": " def __coerce__(a, b):\n return a, Rat(b)", "metadata": "root.Rat.__coerce__", "header": "['class', 'Rat', ':', '___EOS___']", "index": 232 } ]
[ { "span": "def __add__(a, b):", "start_line": 106, "start_column": 4, "end_line": 106, "end_column": 22 }, { "span": "def __radd__(b, a):", "start_line": 115, "start_column": 4, "end_line": 115, "end_column": 23 }, { "span": "def __sub__(a, b):", "start_line": 119, "start_column": 4, "end_line": 119, "end_column": 22 }, { "span": "def __rsub__(b, a):", "start_line": 128, "start_column": 4, "end_line": 128, "end_column": 23 }, { "span": "def __mul__(a, b):", "start_line": 132, "start_column": 4, "end_line": 132, "end_column": 22 }, { "span": "def __rmul__(b, a):", "start_line": 139, "start_column": 4, "end_line": 139, "end_column": 23 }, { "span": "def __div__(a, b):", "start_line": 143, "start_column": 4, "end_line": 143, "end_column": 22 }, { "span": "def __rdiv__(b, a):", "start_line": 150, "start_column": 4, "end_line": 150, "end_column": 23 }, { "span": "def __mod__(a, b):", "start_line": 154, "start_column": 4, "end_line": 154, "end_column": 22 }, { "span": "def __rmod__(b, a):", "start_line": 162, "start_column": 4, "end_line": 162, "end_column": 23 }, { "span": "def __pow__(a, b):", "start_line": 166, "start_column": 4, "end_line": 166, "end_column": 22 }, { "span": "def __rpow__(b, a):", "start_line": 183, "start_column": 4, "end_line": 183, "end_column": 23 }, { "span": "def __neg__(a):", "start_line": 187, "start_column": 4, "end_line": 187, "end_column": 19 }, { "span": "def __abs__(a):", "start_line": 195, "start_column": 4, "end_line": 195, "end_column": 19 }, { "span": "def __int__(a):", "start_line": 199, "start_column": 4, "end_line": 199, "end_column": 19 }, { "span": "def __long__(a):", "start_line": 203, "start_column": 4, "end_line": 203, "end_column": 20 }, { "span": "def __float__(a):", "start_line": 207, "start_column": 4, "end_line": 207, "end_column": 21 }, { "span": "def __complex__(a):", "start_line": 211, "start_column": 4, "end_line": 211, "end_column": 23 }, { "span": "def __cmp__(a, b):", "start_line": 215, "start_column": 4, "end_line": 215, "end_column": 22 }, { "span": "def __rcmp__(b, a):", "start_line": 224, "start_column": 4, "end_line": 224, "end_column": 23 }, { "span": "def __nonzero__(a):", "start_line": 228, "start_column": 4, "end_line": 228, "end_column": 23 }, { "span": "def __coerce__(a, b):", "start_line": 232, "start_column": 4, "end_line": 232, "end_column": 25 } ]
[]
1
true
[ "[CLS]_", "First_", "parameter_", "of_", "a_", "method_", "is_", "not_", "named_", "'", "self", "'_", "[SEP]_", "class_", "Rat", "_", ":_", "\\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", "add\\u\\u_", "(_", "a_", ",_", "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 ", " _", "return_", "rat", "_", "(_", "a_", "._", "\\u\\u", "num_", "*_", "b_", "._", "\\u\\u", "den_", "+_", "b_", "._", "\\u\\u", "num_", "*_", "a_", "._", "\\u\\u", "den_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "._", "\\u\\u", "den_", "*_", "b_", "._", "\\u\\u", "den_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Over", "flow", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "rat", "_", "(_", "long_", "(_", "a_", "._", "\\u\\u", "num_", ")_", "*_", "long_", "(_", "b_", "._", "\\u\\u", "den_", ")_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "long_", "(_", "b_", "._", "\\u\\u", "num_", ")_", "*_", "long_", "(_", "a_", "._", "\\u\\u", "den_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "long_", "(_", "a_", "._", "\\u\\u", "den_", ")_", "*_", "long_", "(_", "b_", "._", "\\u\\u", "den_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\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", "rad", "d\\u\\u_", "(_", "b_", ",_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Rat", "_", "(_", "a_", ")_", "+_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "sub\\u", "\\u_", "(_", "a_", ",_", "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 ", " _", "return_", "rat", "_", "(_", "a_", "._", "\\u\\u", "num_", "*_", "b_", "._", "\\u\\u", "den_", "-_", "b_", "._", "\\u\\u", "num_", "*_", "a_", "._", "\\u\\u", "den_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "a_", "._", "\\u\\u", "den_", "*_", "b_", "._", "\\u\\u", "den_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Over", "flow", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "rat", "_", "(_", "long_", "(_", "a_", "._", "\\u\\u", "num_", ")_", "*_", "long_", "(_", "b_", "._", "\\u\\u", "den_", ")_", "-_", "\\u\\u\\uNL\\u\\u\\u_", "long_", "(_", "b_", "._", "\\u\\u", "num_", ")_", "*_", "long_", "(_", "a_", "._", "\\u\\u", "den_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "long_", "(_", "a_", "._", "\\u\\u", "den_", ")_", "*_", "long_", "(_", "b_", "._", "\\u\\u", "den_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\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", "rsu", "b", "\\u\\u_", "(_", "b_", ",_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Rat", "_", "(_", "a_", ")_", "-_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "mul\\u\\u_", "(_", "a_", ",_", "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 ", " _", "return_", "rat", "_", "(_", "a_", "._", "\\u\\u", "num_", "*_", "b_", "._", "\\u\\u", "num_", ",_", "a_", "._", "\\u\\u", "den_", "*_", "b_", "._", "\\u\\u", "den_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Over", "flow", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "rat", "_", "(_", "long_", "(_", "a_", "._", "\\u\\u", "num_", ")_", "*_", "long_", "(_", "b_", "._", "\\u\\u", "num_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "long_", "(_", "a_", "._", "\\u\\u", "den_", ")_", "*_", "long_", "(_", "b_", "._", "\\u\\u", "den_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\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", "rm", "ul", "\\u\\u_", "(_", "b_", ",_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Rat", "_", "(_", "a_", ")_", "*_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "div\\u\\u_", "(_", "a_", ",_", "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 ", " _", "return_", "rat", "_", "(_", "a_", "._", "\\u\\u", "num_", "*_", "b_", "._", "\\u\\u", "den_", ",_", "a_", "._", "\\u\\u", "den_", "*_", "b_", "._", "\\u\\u", "num_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Over", "flow", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "rat", "_", "(_", "long_", "(_", "a_", "._", "\\u\\u", "num_", ")_", "*_", "long_", "(_", "b_", "._", "\\u\\u", "den_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "long_", "(_", "a_", "._", "\\u\\u", "den_", ")_", "*_", "long_", "(_", "b_", "._", "\\u\\u", "num_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\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", "rdi", "v", "\\u\\u_", "(_", "b_", ",_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Rat", "_", "(_", "a_", ")_", "/_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "mod", "\\u\\u_", "(_", "a_", ",_", "b_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "div_", "=_", "a_", "/_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "div_", "=_", "int_", "(_", "div_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Over", "flow", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "div_", "=_", "long_", "(_", "div_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "a_", "-_", "b_", "*_", "div_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "rmo", "d\\u\\u_", "(_", "b_", ",_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Rat", "_", "(_", "a_", ")_", "%_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "pow", "\\u\\u_", "(_", "a_", ",_", "b_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "b_", "._", "\\u\\u", "den_", "!=_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "isinstance_", "(_", "a_", "._", "\\u\\u", "num_", ",_", "complex_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "a_", "=_", "complex_", "(_", "a_", ")_", "\\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 ", " _", "a_", "=_", "float_", "(_", "a_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "isinstance_", "(_", "b_", "._", "\\u\\u", "num_", ",_", "complex_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "=_", "complex_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "b_", "=_", "float_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "a_", "**_", "b_", "\\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 ", " _", "return_", "rat", "_", "(_", "a_", "._", "\\u\\u", "num_", "**_", "b_", "._", "\\u\\u", "num_", ",_", "a_", "._", "\\u\\u", "den_", "**_", "b_", "._", "\\u\\u", "num_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Over", "flow", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "rat", "_", "(_", "long_", "(_", "a_", "._", "\\u\\u", "num_", ")_", "**_", "b_", "._", "\\u\\u", "num_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "long_", "(_", "a_", "._", "\\u\\u", "den_", ")_", "**_", "b_", "._", "\\u\\u", "num_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\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", "rpo", "w", "\\u\\u_", "(_", "b_", ",_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "Rat", "_", "(_", "a_", ")_", "**_", "b_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "neg", "\\u\\u_", "(_", "a_", ")_", ":_", "\\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_", "rat", "_", "(_", "-_", "a_", "._", "\\u\\u", "num_", ",_", "a_", "._", "\\u\\u", "den_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Over", "flow", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "a", ".\\u", "\\u", "num", " ", "==", " ", "sys", ".", "maxint_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "rat", "_", "(_", "-_", "long_", "(_", "a_", "._", "\\u\\u", "num_", ")_", ",_", "a_", "._", "\\u\\u", "den_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\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", "abs", "\\u\\u_", "(_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "rat", "_", "(_", "abs_", "(_", "a_", "._", "\\u\\u", "num_", ")_", ",_", "a_", "._", "\\u\\u", "den_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "int\\u", "\\u_", "(_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "int_", "(_", "a_", "._", "\\u\\u", "num_", "/_", "a_", "._", "\\u\\u", "den_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "long", "\\u\\u_", "(_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "long_", "(_", "a_", "._", "\\u\\u", "num_", ")_", "/_", "long_", "(_", "a_", "._", "\\u\\u", "den_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "float", "\\u\\u_", "(_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "float_", "(_", "a_", "._", "\\u\\u", "num_", ")_", "/_", "float_", "(_", "a_", "._", "\\u\\u", "den_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "complex", "\\u\\u_", "(_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "complex_", "(_", "a_", "._", "\\u\\u", "num_", ")_", "/_", "complex_", "(_", "a_", "._", "\\u\\u", "den_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "cmp", "\\u\\u_", "(_", "a_", ",_", "b_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "diff_", "=_", "Rat", "_", "(_", "a_", "-_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "diff_", "._", "\\u\\u", "num_", "<_", "0_", ":_", "\\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_", "elif_", "diff_", "._", "\\u\\u", "num_", ">_", "0_", ":_", "\\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_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\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", "rcm", "p", "\\u\\u_", "(_", "b_", ",_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "cmp_", "(_", "Rat", "_", "(_", "a_", ")_", ",_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "nonzero\\u", "\\u_", "(_", "a_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "a_", "._", "\\u\\u", "num_", "!=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Rat", "_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u\\u", "coerce", "\\u\\u_", "(_", "a_", ",_", "b_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "a_", ",_", "Rat", "_", "(_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4, 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, 4, 2, 2, 2, 2, 2, 2, 0, 1, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Imprecise assert
OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/test/test_distsim.py
[ { "content": " def test_1_client(self):\n logging.debug('')\n logging.debug('test_client')\n\n factory = self.start_factory()\n\n # List available types.\n types = factory.get_available_types()\n logging.debug('Available types:')\n for typname, version in types:\n logging.debug(' %s %s', typname, version)\n\n # First a HollowSphere, accessed via get()/set().\n obj = factory.create(_MODULE+'.HollowSphere')\n sphere_pid = obj.get('pid')\n self.assertNotEqual(sphere_pid, os.getpid())\n\n radius = obj.get('radius')\n self.assertEqual(radius, 1.)\n radius += 1\n obj.set('radius', radius)\n new_radius = obj.get('radius')\n self.assertEqual(new_radius, 2.)\n self.assertEqual(obj.get('inner_volume'), 0.)\n self.assertEqual(obj.get('volume'), 0.)\n self.assertEqual(obj.get('solid_volume'), 0.)\n self.assertEqual(obj.get('surface_area'), 0.)\n obj.run()\n assert_rel_error(self, obj.get('inner_volume'), 33.510321638, 0.000001)\n assert_rel_error(self, obj.get('volume'), 36.086951213, 0.000001)\n assert_rel_error(self, obj.get('solid_volume'), 2.5766295747, 0.000001)\n assert_rel_error(self, obj.get('surface_area'), 50.265482457, 0.000001)\n\n try:\n obj.set('radius', -1)\n except RemoteError as exc:\n fragment = \": Variable 'radius' must be a float in the range (0.0, \"\n if fragment not in str(exc):\n self.fail('%s not found in %s' % (fragment, exc))\n else:\n self.fail('Expected RemoteError')\n\n # Now a Box, accessed via attribute methods.\n obj = factory.create(_MODULE+'.Box')\n box_pid = obj.get('pid')\n self.assertNotEqual(box_pid, os.getpid())\n self.assertNotEqual(box_pid, sphere_pid)\n\n obj.width += 2\n obj.height += 2\n obj.depth += 2\n self.assertEqual(obj.width, 2.)\n self.assertEqual(obj.height, 2.)\n self.assertEqual(obj.depth, 2.)\n self.assertEqual(obj.volume, 0.)\n self.assertEqual(obj.surface_area, 0.)\n obj.run()\n self.assertEqual(obj.volume, 8.0)\n self.assertEqual(obj.surface_area, 24.0)\n\n try:\n obj.no_rbac()\n except RemoteError as exc:\n msg = \"AttributeError: method 'no_rbac' of\"\n logging.debug('msg: %s', msg)\n logging.debug('exc: %s', exc)\n self.assertTrue(msg in str(exc))\n else:\n self.fail('Expected RemoteError')", "metadata": "root.TestCase.test_1_client", "header": "['class', 'TestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 359 }, { "content": " def test_2_model(self):\n logging.debug('')\n logging.debug('test_model')\n\n factory = self.start_factory()\n\n # Create model and run it.\n box = factory.create(_MODULE+'.Box')\n model = set_as_top(Model(box))\n model.run()\n\n # Check results.\n for width in range(1, 2):\n for height in range(1, 3):\n for depth in range(1, 4):\n case = model.recorders[0].cases.pop(0)\n self.assertEqual(case.get_output('volume'),\n width*height*depth)\n\n self.assertTrue(is_instance(model.box.parent, Assembly))\n self.assertTrue(has_interface(model.box.parent, IComponent))\n\n # Upcall to use parent to resolve sibling.\n # At one time this caused proxy problems.\n source = model.box.parent.source\n self.assertEqual(source.width_in, 1.)\n\n # Proxy resolution.\n obj, path = get_closest_proxy(model, 'box.subcontainer.subvar')\n self.assertEqual(obj, model.box)\n self.assertEqual(path, 'subcontainer.subvar')\n\n obj, path = get_closest_proxy(model, 'source.subcontainer.subvar')\n self.assertEqual(obj, model.source.subcontainer.subvar)\n self.assertEqual(path, '')\n\n obj, path = get_closest_proxy(model.source.subcontainer, 'subvar')\n self.assertEqual(obj, model.source.subcontainer.subvar)\n self.assertEqual(path, '')\n\n # Observable proxied type.\n tmp = model.box.open_in_parent('tmp', 'w')\n tmp.close()\n os.remove('tmp')\n\n # Cause server-side errors we can see.\n\n try:\n box.cause_parent_error1()\n except RemoteError as exc:\n msg = \"AttributeError: 'Model' object has no attribute 'no_such_variable'\"\n logging.debug('msg: %s', msg)\n logging.debug('exc: %s', exc)\n self.assertTrue(msg in str(exc))\n else:\n self.fail('Expected RemoteError')\n\n try:\n box.cause_parent_error2()\n except RemoteError as exc:\n msg = \"AttributeError: method 'get_trait' of\"\n logging.debug('msg: %s', msg)\n logging.debug('exc: %s', exc)\n self.assertTrue(msg in str(exc))\n else:\n self.fail('Expected RemoteError')\n\n try:\n box.cause_parent_error3()\n except RemoteError as exc:\n msg = \"RoleError: xyzzy(): No access for role 'owner'\"\n logging.debug('msg: %s', msg)\n logging.debug('exc: %s', exc)\n self.assertTrue(msg in str(exc))\n else:\n self.fail('Expected RemoteError')", "metadata": "root.TestCase.test_2_model", "header": "['class', 'TestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 429 }, { "content": " def test_3_access(self):\n logging.debug('')\n logging.debug('test_access')\n\n # This 'spook' creation is only for testing.\n # Normally the protector would run with regular credentials\n # in effect at the proprietary site.\n user = 'i am a spy@'+socket.gethostname()\n key_pair = get_key_pair(user)\n data = '\\n'.join([user, '0', key_pair.publickey().exportKey()])\n hash = hashlib.sha256(data).digest()\n signature = key_pair.sign(hash, get_random_bytes)\n spook = Credentials((data, signature, None))\n\n credentials = get_credentials()\n allowed_users = {credentials.user: credentials.public_key,\n spook.user: spook.public_key}\n factory = self.start_factory(allowed_users=allowed_users)\n\n # Create model and run it.\n saved = get_credentials()\n set_credentials(spook)\n box = factory.create(_MODULE+'.ProtectedBox',\n allowed_users=allowed_users)\n set_credentials(saved)\n\n model = set_as_top(Model(box))\n model.run()\n\n # Check results.\n for width in range(1, 2):\n for height in range(1, 3):\n for depth in range(1, 4):\n case = model.recorders[0].cases.pop(0)\n self.assertEqual(case.get_output('volume'),\n width*height*depth)\n\n # Check access protections.\n try:\n i = model.box.secret\n except RemoteError as exc:\n msg = \"RoleError: No __getattribute__ access to 'secret' by role 'user'\"\n logging.debug('msg: %s', msg)\n logging.debug('exc: %s', exc)\n self.assertTrue(msg in str(exc))\n else:\n self.fail('Expected RemoteError')\n\n try:\n model.box.proprietary_method()\n except RemoteError as exc:\n msg = \"RoleError: proprietary_method(): No access for role 'user'\"\n logging.debug('msg: %s', msg)\n logging.debug('exc: %s', exc)\n self.assertTrue(msg in str(exc))\n else:\n self.fail('Expected RemoteError')\n\n saved = get_credentials()\n set_credentials(spook)\n try:\n i = model.box.secret\n model.box.proprietary_method()\n finally:\n # Reset credentials to allow factory shutdown.\n set_credentials(saved)", "metadata": "root.TestCase.test_3_access", "header": "['class', 'TestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 506 }, { "content": " def test_5_misc(self):\n logging.debug('')\n logging.debug('test_misc')\n\n factory = self.start_factory()\n\n # Try using a server after being released, server never used before.\n # This usually results in a \"Can't connect\" error, but sometimes gets a\n # \"Can't send\" error, based on timing/proxying.\n server = factory.create('')\n factory.release(server)\n msg1 = \"Can't connect to server at\"\n msg2 = \"Can't send to server at\"\n try:\n reply = server.echo('hello')\n except RuntimeError as exc:\n if str(exc)[:len(msg1)] != msg1 and str(exc)[:len(msg2)] != msg2:\n self.fail('Expected connect/send error, got %r' % exc)\n else:\n self.fail('Expected RuntimeError')\n\n # Try using a server after being released, server has been used before.\n # This usually results in a \"Can't send\" error, but sometimes gets a\n # \"Can't connect\" error, based on timing/proxying.\n server = factory.create('')\n reply = server.echo('hello')\n factory.release(server)\n msg1 = \"Can't send to server at\"\n msg2 = \"Can't connect to server at\"\n try:\n reply = server.echo('hello')\n except RuntimeError as exc:\n if str(exc)[:len(msg1)] != msg1 and str(exc)[:len(msg2)] != msg2:\n self.fail('Expected send/connect error, got %r' % exc)\n except EOFError: # this can happen when testing concurrently\n pass\n else:\n self.fail('Expected RuntimeError')\n\n # Try releasing a server twice. Depending on timing, this could\n # result in a ValueError trying to identify the server to release or\n # a RemoteError where the request can't be unpacked. The timing seems\n # to be sensitive to AF_INET/AF_UNIX connection type.\n server = factory.create('')\n factory.release(server)\n msg1 = \"can't identify server \"\n msg2 = \"RuntimeError: Can't decrypt/unpack request.\" \\\n \" This could be the result of referring to a dead server.\"\n try:\n factory.release(server)\n except ValueError as exc:\n self.assertEqual(str(exc)[:len(msg1)], msg1)\n except RemoteError as exc:\n self.assertTrue(msg2 in str(exc))\n else:\n self.fail('Expected ValueError or RemoteError')\n\n # Check false return of has_interface().\n self.assertFalse(has_interface(factory, HasObjectives))\n\n # Try to connect to wrong port (assuming junk_port isn't being used!)\n address = socket.gethostname()\n junk_port = 12345\n assert_raises(self, 'connect(address, junk_port, pubkey=self.key)',\n globals(), locals(), RuntimeError, \"Can't connect to \")\n\n # Unpickleable argument.\n code = compile('3 + 4', '<string>', 'eval')\n assert_raises(self, 'factory.echo(code)', globals(), locals(),\n cPickle.PicklingError, \"Can't pickle <type 'code'>\")\n\n # Server startup failure.\n assert_raises(self, 'self.start_factory(port=0, allowed_users={})',\n globals(), locals(), RuntimeError,\n 'Server startup failed')", "metadata": "root.TestCase.test_5_misc", "header": "['class', 'TestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 636 } ]
[ { "span": "self.assertTrue(msg in str(exc))", "start_line": 425, "start_column": 12, "end_line": 425, "end_column": 44 }, { "span": "self.assertTrue(msg in str(exc))", "start_line": 482, "start_column": 12, "end_line": 482, "end_column": 44 }, { "span": "self.assertTrue(msg in str(exc))", "start_line": 492, "start_column": 12, "end_line": 492, "end_column": 44 }, { "span": "self.assertTrue(msg in str(exc))", "start_line": 502, "start_column": 12, "end_line": 502, "end_column": 44 }, { "span": "self.assertTrue(msg in str(exc))", "start_line": 550, "start_column": 12, "end_line": 550, "end_column": 44 }, { "span": "self.assertTrue(msg in str(exc))", "start_line": 560, "start_column": 12, "end_line": 560, "end_column": 44 }, { "span": "self.assertTrue(msg2 in str(exc))", "start_line": 689, "start_column": 12, "end_line": 689, "end_column": 45 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Test", "Case_", "(_", "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_", "def_", "test\\u", "1", "\\u", "client_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "test\\u", "client", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "factory_", "=_", "self_", "._", "start", "\\u", "factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "List", " ", "avail", "able", " ", "types", "._", "\\u\\u\\uNL\\u\\u\\u_", "types_", "=_", "factory_", "._", "get", "\\u", "avail", "able", "\\u", "types_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "Avail", "able", " ", "types", ":'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "typ", "name_", ",_", "version_", "in_", "types_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "'", " ", " ", " ", "%", "s", " ", "%", "s", "'_", ",_", "typ", "name_", ",_", "version_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fi", "rst", " ", "a", " ", "Hol", "low", "Sphere", ",", " ", "accesse", "d", " ", "via", " ", "get", "()", "/", "set", "()", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "obj_", "=_", "factory_", "._", "create_", "(_", "\\u", "MODULE_", "+_", "'.", "Hol", "low", "Sphere", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sphere", "\\u", "pid_", "=_", "obj_", "._", "get_", "(_", "'", "pid", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "sphere", "\\u", "pid_", ",_", "os_", "._", "getpid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "radius_", "=_", "obj_", "._", "get_", "(_", "'", "radi", "us", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "radius_", ",_", "1._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "radius_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "set_", "(_", "'", "radi", "us", "'_", ",_", "radius_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "radius_", "=_", "obj_", "._", "get_", "(_", "'", "radi", "us", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "new", "\\u", "radius_", ",_", "2._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj_", "._", "get_", "(_", "'", "inner", "\\u", "volume", "'_", ")_", ",_", "0._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj_", "._", "get_", "(_", "'", "volume", "'_", ")_", ",_", "0._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj_", "._", "get_", "(_", "'", "solid", "\\u", "volume", "'_", ")_", ",_", "0._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj_", "._", "get_", "(_", "'", "surf", "ace", "\\u", "area", "'_", ")_", ",_", "0._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "obj_", "._", "get_", "(_", "'", "inner", "\\u", "volume", "'_", ")_", ",_", "33.", "510", "321", "638", "_", ",_", "0.000001", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "obj_", "._", "get_", "(_", "'", "volume", "'_", ")_", ",_", "36.", "086", "951", "213_", ",_", "0.000001", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "obj_", "._", "get_", "(_", "'", "solid", "\\u", "volume", "'_", ")_", ",_", "2.5", "766", "295", "747", "_", ",_", "0.000001", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "rel", "\\u", "error_", "(_", "self_", ",_", "obj_", "._", "get_", "(_", "'", "surf", "ace", "\\u", "area", "'_", ")_", ",_", "50.", "265", "482", "457", "_", ",_", "0.000001", "_", ")_", "\\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 ", " _", "obj_", "._", "set_", "(_", "'", "radi", "us", "'_", ",_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Remo", "te", "Error_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "fragment_", "=_", "\":", " ", "Varia", "ble", " ", "'", "radi", "us", "'", " ", "must", " ", "be", " ", "a", " ", "float", " ", "in", " ", "the", " ", "range", " ", "(", "0.", "0", ",", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "fragment_", "not_", "in_", "str_", "(_", "exc_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "'%", "s", " ", "not", " ", "found", " ", "in", " ", "%", "s", "'_", "%_", "(_", "fragment_", ",_", "exc_", ")_", ")_", "\\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_", "._", "fail_", "(_", "'", "Expect", "ed", " ", "Remo", "te", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "No", "w", " ", "a", " ", "Box", ",", " ", "accesse", "d", " ", "via", " ", "attribute", " ", "method", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "obj_", "=_", "factory_", "._", "create_", "(_", "\\u", "MODULE_", "+_", "'.", "Box", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "box", "\\u", "pid_", "=_", "obj_", "._", "get_", "(_", "'", "pid", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "box", "\\u", "pid_", ",_", "os_", "._", "getpid_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Not", "Equal_", "(_", "box", "\\u", "pid_", ",_", "sphere", "\\u", "pid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "obj_", "._", "width_", "+=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "height_", "+=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "depth_", "+=_", "2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj_", "._", "width_", ",_", "2._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj_", "._", "height_", ",_", "2._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj_", "._", "depth_", ",_", "2._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj_", "._", "volume_", ",_", "0._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj_", "._", "surf", "ace", "\\u", "area_", ",_", "0._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "obj_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj_", "._", "volume_", ",_", "8.0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj_", "._", "surf", "ace", "\\u", "area_", ",_", "24.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 ", " _", "obj_", "._", "no", "\\u", "rbac", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Remo", "te", "Error_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "Attribute", "Error", ":", " ", "method", " ", "'", "no", "\\u", "rbac", "'", " ", "of", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "msg", ":", " ", "%", "s", "'_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "exc", ":", " ", "%", "s", "'_", ",_", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "msg_", "in_", "str_", "(_", "exc_", ")_", ")_", "\\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_", "(_", "'", "Expect", "ed", " ", "Remo", "te", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Case_", "(_", "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", "2", "\\u", "model_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "test\\u", "model", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "factory_", "=_", "self_", "._", "start", "\\u", "factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "model", " ", "and", " ", "run", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "box_", "=_", "factory_", "._", "create_", "(_", "\\u", "MODULE_", "+_", "'.", "Box", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Model_", "(_", "box_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "results", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "width_", "in_", "range_", "(_", "1_", ",_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "height_", "in_", "range_", "(_", "1_", ",_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "depth_", "in_", "range_", "(_", "1_", ",_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "case_", "=_", "model_", "._", "recorde", "rs_", "[_", "0_", "]_", "._", "cases_", "._", "pop_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "output_", "(_", "'", "volume", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "width_", "*_", "height_", "*_", "depth_", ")_", "\\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_", "self_", "._", "assert", "True_", "(_", "is", "\\u", "instance_", "(_", "model_", "._", "box_", "._", "parent_", ",_", "Asse", "mbly", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "has", "\\u", "interface_", "(_", "model_", "._", "box_", "._", "parent_", ",_", "IC", "omp", "one", "nt_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Up", "call", " ", "to", " ", "use", " ", "parent", " ", "to", " ", "resolve", " ", "sib", "ling", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "At", " ", "one", " ", "time", " ", "this", " ", "caus", "ed", " ", "proxy", " ", "problem", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "source_", "=_", "model_", "._", "box_", "._", "parent_", "._", "source_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "source_", "._", "widt", "h", "\\u", "in_", ",_", "1._", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Pro", "xy", " ", "resolu", "tion", "._", "\\u\\u\\uNL\\u\\u\\u_", "obj_", ",_", "path_", "=_", "get", "\\u", "closest", "\\u", "proxy_", "(_", "model_", ",_", "'", "box", ".", "subcon", "tain", "er", ".", "subv", "ar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj_", ",_", "model_", "._", "box_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "path_", ",_", "'", "subcon", "tain", "er", ".", "subv", "ar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "obj_", ",_", "path_", "=_", "get", "\\u", "closest", "\\u", "proxy_", "(_", "model_", ",_", "'", "source", ".", "subcon", "tain", "er", ".", "subv", "ar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj_", ",_", "model_", "._", "source_", "._", "subcon", "tain", "er_", "._", "subv", "ar_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "path_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "obj_", ",_", "path_", "=_", "get", "\\u", "closest", "\\u", "proxy_", "(_", "model_", "._", "source_", "._", "subcon", "tain", "er_", ",_", "'", "subv", "ar", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "obj_", ",_", "model_", "._", "source_", "._", "subcon", "tain", "er_", "._", "subv", "ar_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "path_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Observa", "ble", " ", "prox", "ied", " ", "type", "._", "\\u\\u\\uNL\\u\\u\\u_", "tmp_", "=_", "model_", "._", "box_", "._", "open", "\\u", "in", "\\u", "parent_", "(_", "'", "tmp", "'_", ",_", "'", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tmp_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "os_", "._", "remove_", "(_", "'", "tmp", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Cause", " ", "server", "-", "side", " ", "error", "s", " ", "we", " ", "can", " ", "see", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "box_", "._", "caus", "e\\u", "parent", "\\u", "error", "1_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Remo", "te", "Error_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "Attribute", "Error", ":", " ", "'", "Model", "'", " ", "object", " ", "has", " ", "no", " ", "attribute", " ", "'", "no", "\\u", "suc", "h", "\\u", "variab", "le", "'\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "msg", ":", " ", "%", "s", "'_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "exc", ":", " ", "%", "s", "'_", ",_", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "msg_", "in_", "str_", "(_", "exc_", ")_", ")_", "\\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_", "(_", "'", "Expect", "ed", " ", "Remo", "te", "Error", "'_", ")_", "\\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 ", " _", "box_", "._", "caus", "e\\u", "parent", "\\u", "error", "2_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Remo", "te", "Error_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "Attribute", "Error", ":", " ", "method", " ", "'", "get", "\\u", "tra", "it", "'", " ", "of", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "msg", ":", " ", "%", "s", "'_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "exc", ":", " ", "%", "s", "'_", ",_", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "msg_", "in_", "str_", "(_", "exc_", ")_", ")_", "\\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_", "(_", "'", "Expect", "ed", " ", "Remo", "te", "Error", "'_", ")_", "\\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 ", " _", "box_", "._", "caus", "e\\u", "parent", "\\u", "error", "3_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Remo", "te", "Error_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "Ro", "le", "Error", ":", " ", "xyz", "zy", "():", " ", "No", " ", "access", " ", "for", " ", "role", " ", "'", "owner", "'\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "msg", ":", " ", "%", "s", "'_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "exc", ":", " ", "%", "s", "'_", ",_", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "msg_", "in_", "str_", "(_", "exc_", ")_", ")_", "\\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_", "(_", "'", "Expect", "ed", " ", "Remo", "te", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Case_", "(_", "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", "3", "\\u", "access_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "test\\u", "access", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "'", "spoo", "k", "'", " ", "creati", "on", " ", "is", " ", "only", " ", "for", " ", "testi", "ng", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Normal", "ly", " ", "the", " ", "protect", "or", " ", "wou", "ld", " ", "run", " ", "with", " ", "regular", " ", "credentials_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "in", " ", "effect", " ", "at", " ", "the", " ", "prop", "rie", "tar", "y", " ", "site", "._", "\\u\\u\\uNL\\u\\u\\u_", "user_", "=_", "'", "i", " ", "am", " ", "a", " ", "spy", "@'_", "+_", "socket_", "._", "gethostname_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "key", "\\u", "pair_", "=_", "get", "\\u", "key", "\\u", "pair_", "(_", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "'\\\\", "n", "'_", "._", "join_", "(_", "[_", "user_", ",_", "'", "0", "'_", ",_", "key", "\\u", "pair_", "._", "public", "key_", "(_", ")_", "._", "export", "Key_", "(_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "hash_", "=_", "hashlib_", "._", "sha256_", "(_", "data_", ")_", "._", "digest_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "signature_", "=_", "key", "\\u", "pair_", "._", "sign_", "(_", "hash_", ",_", "get", "\\u", "random", "\\u", "bytes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "spoo", "k_", "=_", "Credentials_", "(_", "(_", "data_", ",_", "signature_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "credentials_", "=_", "get", "\\u", "credentials_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "allow", "ed", "\\u", "users_", "=_", "{_", "credentials_", "._", "user_", ":_", "credentials_", "._", "public", "\\u", "key_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "spoo", "k_", "._", "user_", ":_", "spoo", "k_", "._", "public", "\\u", "key_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "factory_", "=_", "self_", "._", "start", "\\u", "factory_", "(_", "allow", "ed", "\\u", "users_", "=_", "allow", "ed", "\\u", "users_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Creat", "e", " ", "model", " ", "and", " ", "run", " ", "it", "._", "\\u\\u\\uNL\\u\\u\\u_", "saved_", "=_", "get", "\\u", "credentials_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "credentials_", "(_", "spoo", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "box_", "=_", "factory_", "._", "create_", "(_", "\\u", "MODULE_", "+_", "'.", "Protect", "ed", "Box", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "allow", "ed", "\\u", "users_", "=_", "allow", "ed", "\\u", "users_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "credentials_", "(_", "saved_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model_", "=_", "set\\u", "as", "\\u", "top_", "(_", "Model_", "(_", "box_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "run_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "results", "._", "\\u\\u\\uNL\\u\\u\\u_", "for_", "width_", "in_", "range_", "(_", "1_", ",_", "2_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "height_", "in_", "range_", "(_", "1_", ",_", "3_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "depth_", "in_", "range_", "(_", "1_", ",_", "4_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "case_", "=_", "model_", "._", "recorde", "rs_", "[_", "0_", "]_", "._", "cases_", "._", "pop_", "(_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "Equal_", "(_", "case_", "._", "get", "\\u", "output_", "(_", "'", "volume", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "width_", "*_", "height_", "*_", "depth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "access", " ", "protection", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "model_", "._", "box_", "._", "secret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Remo", "te", "Error_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "Ro", "le", "Error", ":", " ", "No", " ", "\\u\\u", "getattr", "ibut", "e\\u", "\\u", " ", "access", " ", "to", " ", "'", "secret", "'", " ", "by", " ", "role", " ", "'", "user", "'\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "msg", ":", " ", "%", "s", "'_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "exc", ":", " ", "%", "s", "'_", ",_", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "msg_", "in_", "str_", "(_", "exc_", ")_", ")_", "\\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_", "(_", "'", "Expect", "ed", " ", "Remo", "te", "Error", "'_", ")_", "\\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 ", " _", "model_", "._", "box_", "._", "prop", "rie", "tar", "y", "\\u", "method_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Remo", "te", "Error_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "=_", "\"", "Ro", "le", "Error", ":", " ", "prop", "rie", "tar", "y", "\\u", "method", "():", " ", "No", " ", "access", " ", "for", " ", "role", " ", "'", "user", "'\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "msg", ":", " ", "%", "s", "'_", ",_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "exc", ":", " ", "%", "s", "'_", ",_", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "msg_", "in_", "str_", "(_", "exc_", ")_", ")_", "\\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_", "(_", "'", "Expect", "ed", " ", "Remo", "te", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "saved_", "=_", "get", "\\u", "credentials_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "credentials_", "(_", "spoo", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "i_", "=_", "model_", "._", "box_", "._", "secret_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "model_", "._", "box_", "._", "prop", "rie", "tar", "y", "\\u", "method_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finally_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Reset", " ", "cred", "ential", "s", " ", "to", " ", "allow", " ", "factor", "y", " ", "shut", "down", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "set\\u", "credentials_", "(_", "saved_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Case_", "(_", "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", "5", "\\u", "misc_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "logging_", "._", "debug_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logging_", "._", "debug_", "(_", "'", "test\\u", "misc", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "factory_", "=_", "self_", "._", "start", "\\u", "factory_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "usi", "ng", " ", "a", " ", "server", " ", "after", " ", "bei", "ng", " ", "released", ",", " ", "server", " ", "neve", "r", " ", "used", " ", "bef", "ore", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "usual", "ly", " ", "results", " ", "in", " ", "a", " ", "\"", "Can", "'", "t", " ", "connect", "\"", " ", "error", ",", " ", "but", " ", "somet", "imes", " ", "gets", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Can", "'", "t", " ", "send", "\"", " ", "error", ",", " ", "based", " ", "on", " ", "tim", "ing", "/", "proxy", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "server_", "=_", "factory_", "._", "create_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "factory_", "._", "release_", "(_", "server_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "1_", "=_", "\"", "Can", "'", "t", " ", "connect", " ", "to", " ", "server", " ", "at", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "2_", "=_", "\"", "Can", "'", "t", " ", "send", " ", "to", " ", "server", " ", "at", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reply_", "=_", "server_", "._", "echo_", "(_", "'", "hell", "o", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Run", "time", "Error_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "str_", "(_", "exc_", ")_", "[_", ":_", "len_", "(_", "msg", "1_", ")_", "]_", "!=_", "msg", "1_", "and_", "str_", "(_", "exc_", ")_", "[_", ":_", "len_", "(_", "msg", "2_", ")_", "]_", "!=_", "msg", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "'", "Expect", "ed", " ", "connect", "/", "send", " ", "error", ",", " ", "got", " ", "%", "r", "'_", "%_", "exc_", ")_", "\\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_", "._", "fail_", "(_", "'", "Expect", "ed", " ", "Run", "time", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "usi", "ng", " ", "a", " ", "server", " ", "after", " ", "bei", "ng", " ", "released", ",", " ", "server", " ", "has", " ", "bee", "n", " ", "used", " ", "bef", "ore", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "usual", "ly", " ", "results", " ", "in", " ", "a", " ", "\"", "Can", "'", "t", " ", "send", "\"", " ", "error", ",", " ", "but", " ", "somet", "imes", " ", "gets", " ", "a_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"", "Can", "'", "t", " ", "connect", "\"", " ", "error", ",", " ", "based", " ", "on", " ", "tim", "ing", "/", "proxy", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "server_", "=_", "factory_", "._", "create_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "reply_", "=_", "server_", "._", "echo_", "(_", "'", "hell", "o", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "factory_", "._", "release_", "(_", "server_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "1_", "=_", "\"", "Can", "'", "t", " ", "send", " ", "to", " ", "server", " ", "at", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "2_", "=_", "\"", "Can", "'", "t", " ", "connect", " ", "to", " ", "server", " ", "at", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "reply_", "=_", "server_", "._", "echo_", "(_", "'", "hell", "o", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Run", "time", "Error_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "str_", "(_", "exc_", ")_", "[_", ":_", "len_", "(_", "msg", "1_", ")_", "]_", "!=_", "msg", "1_", "and_", "str_", "(_", "exc_", ")_", "[_", ":_", "len_", "(_", "msg", "2_", ")_", "]_", "!=_", "msg", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "'", "Expect", "ed", " ", "send", "/", "connect", " ", "error", ",", " ", "got", " ", "%", "r", "'_", "%_", "exc_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "EO", "FE", "rror_", ":_", "#", " ", "this", " ", "can", " ", "happ", "en", " ", "whe", "n", " ", "testi", "ng", " ", "concurrent", "ly_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "fail_", "(_", "'", "Expect", "ed", " ", "Run", "time", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "rele", "asin", "g", " ", "a", " ", "server", " ", "twi", "ce", ".", " ", "Depend", "ing", " ", "on", " ", "tim", "ing", ",", " ", "this", " ", "coul", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "result", " ", "in", " ", "a", " ", "Value", "Error", " ", "try", "ing", " ", "to", " ", "identify", " ", "the", " ", "server", " ", "to", " ", "release", " ", "or_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "Remo", "te", "Error", " ", "where", " ", "the", " ", "request", " ", "can", "'", "t", " ", "be", " ", "unpacked", ".", " ", "The", " ", "tim", "ing", " ", "see", "ms_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "to", " ", "be", " ", "sensi", "tiv", "e", " ", "to", " ", "AF", "\\u", "INE", "T", "/", "AF", "\\u", "UNIX", " ", "connecti", "on", " ", "type", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "server_", "=_", "factory_", "._", "create_", "(_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "factory_", "._", "release_", "(_", "server_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "1_", "=_", "\"", "can", "'", "t", " ", "identify", " ", "server", " ", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg", "2_", "=_", "\"", "Run", "time", "Error", ":", " ", "Can", "'", "t", " ", "decrypt", "/", "unpack", " ", "request", ".\"_", "\"", " ", "Thi", "s", " ", "coul", "d", " ", "be", " ", "the", " ", "result", " ", "of", " ", "refer", "ring", " ", "to", " ", "a", " ", "dead", " ", "server", ".\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "factory_", "._", "release_", "(_", "server_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Value", "Error_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "Equal_", "(_", "str_", "(_", "exc_", ")_", "[_", ":_", "len_", "(_", "msg", "1_", ")_", "]_", ",_", "msg", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Remo", "te", "Error_", "as_", "exc_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "assert", "True_", "(_", "msg", "2_", "in_", "str_", "(_", "exc_", ")_", ")_", "\\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_", "(_", "'", "Expect", "ed", " ", "Value", "Error", " ", "or", " ", "Remo", "te", "Error", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Check", " ", "fal", "se", " ", "return", " ", "of", " ", "has", "\\u", "interface", "()", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "assert", "False_", "(_", "has", "\\u", "interface_", "(_", "factory_", ",_", "Has", "Objecti", "ves_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Tr", "y", " ", "to", " ", "connect", " ", "to", " ", "wrong", " ", "port", " ", "(", "ass", "umi", "ng", " ", "junk", "\\u", "port", " ", "isn", "'", "t", " ", "bei", "ng", " ", "used", "!)", "_", "\\u\\u\\uNL\\u\\u\\u_", "address_", "=_", "socket_", "._", "gethostname_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "junk", "\\u", "port_", "=_", "12345_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "raises_", "(_", "self_", ",_", "'", "connect", "(", "address", ",", " ", "junk", "\\u", "port", ",", " ", "pubkey", "=", "self", ".", "key", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "globals_", "(_", ")_", ",_", "locals_", "(_", ")_", ",_", "Run", "time", "Error_", ",_", "\"", "Can", "'", "t", " ", "connect", " ", "to", " ", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Unp", "ickle", "able", " ", "argu", "ment", "._", "\\u\\u\\uNL\\u\\u\\u_", "code_", "=_", "compile_", "(_", "'", "3", " ", "+", " ", "4", "'_", ",_", "'<", "string", ">'_", ",_", "'", "eval", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert", "\\u", "raises_", "(_", "self_", ",_", "'", "factor", "y", ".", "echo", "(", "code", ")'_", ",_", "globals_", "(_", ")_", ",_", "locals_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "c", "Pickle_", "._", "Pickl", "ing", "Error_", ",_", "\"", "Can", "'", "t", " ", "pickle", " ", "<", "type", " ", "'", "code", "'>\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Server", " ", "start", "up", " ", "fail", "ure", "._", "\\u\\u\\uNL\\u\\u\\u_", "assert", "\\u", "raises_", "(_", "self_", ",_", "'", "self", ".", "start", "\\u", "factor", "y", "(", "port", "=", "0", ",", " ", "allow", "ed", "\\u", "users", "={}", ")'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "globals_", "(_", ")_", ",_", "locals_", "(_", ")_", ",_", "Run", "time", "Error_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Server", " ", "start", "up", " ", "fail", "ed", "'_", ")_", "\\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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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 ]
Unused import
dikien/Machine-Learning-Newspaper/nytimes/step4_analysis_supervised_2.py
[ { "content": "# -*- coding: UTF-8 -*-\n\nimport numpy as np\nfrom sklearn.cross_validation import KFold\nfrom sklearn.linear_model import LinearRegression, ElasticNet, Lasso, Ridge, ElasticNetCV\nfrom sklearn.metrics import mean_squared_error, r2_score\nfrom time import time\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.feature_selection import SelectPercentile, f_classif, chi2\nfrom sklearn.feature_selection import SelectKBest, f_regression\nimport pickle\nfrom sklearn import preprocessing\nfrom sklearn import cross_validation\nimport matplotlib.pyplot as plt\nfrom itertools import cycle\n\n\n\n\n\n\nnFeatures = np.arange(10, 40, 10)\n\ndata = {}\n\nfor k in nFeatures:\n\n features, labels, vectorizer, selector, le, features_data = preprocess(\"pkl/article_2_people.pkl\", \"pkl/lable_2_people.pkl\", k)\n features_train, features_test, labels_train, labels_test = cross_validation.train_test_split(features, labels, test_size=0.1, random_state=42)\n\n for name, clf in [\n ('linear regression', LinearRegression(fit_intercept=True)),\n # ('lasso()', Lasso()),\n # ('elastic-net(.5)', ElasticNet(alpha=0.5)),\n # ('lasso(.5)', Lasso(alpha=0.5)),\n # ('ridge(.5)', Ridge(alpha=0.5))\n ]:\n\n if not data.has_key(name):\n data[name] = []\n\n print \"*\" * 100\n print('Method: {}'.format(name) + ' the number of feature is {}'.format(k))\n\n # Fit on the whole data:\n t0 = time()\n clf.fit(features_train, labels_train)\n print (\"training time:\", round(time()-t0, 3), \"s\")\n\n # Predict on the whole data:\n y_pred = clf.predict(features_test)\n print (\"predicting time:\", round(time()-t0, 3), \"s\")\n\n score_accuracy = mean_squared_error(y_pred, labels_test)\n print('r2 score : {}'.format(r2_score(y_pred, labels_test)))\n print('mean squared error : {}'.format(score_accuracy))\n\n print \"*\"* 100\n\n data[name].append(score_accuracy)\n\n\nplot(nFeatures, data)\nprint data", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def plot(nFeatures, data):\n colors = cycle('rgbcmykw')\n algorithm = sorted(data)\n\n fig = plt.figure()\n ax = fig.add_subplot(111)\n\n for j, c in zip(algorithm, colors):\n # for j in algorithm:\n # plt.scatter(nFeatures, data[j], label=j)\n ax.plot(nFeatures, data[j], label=j, color=c)\n ax.scatter(nFeatures, data[j], color=c)\n\n plt.xlabel(\"#-Features(SelectPercentile)\")\n plt.ylabel(\"Mean Squared Error\")\n plt.title(\"Mean Squared Error vs #-Features for different classifiers\")\n # ax.set_xscale(\"log\")\n box = ax.get_position()\n ax.set_position([box.x0, box.y0 + box.height * 0.3,\n box.width, box.height * 0.7])\n ax.legend(loc=\"upper center\", bbox_to_anchor=(0.5, -0.15), fancybox=True, shadow=True, ncol=3)\n # ax.set_ylim(0, 6.0)\n plt.legend(loc=2)\n plt.show()", "metadata": "root.plot", "header": "['module', '___EOS___']", "index": 17 }, { "content": "def preprocess(article_file, lable_file, k):\n\n features = pickle.load(open(article_file))\n features = np.array(features)\n\n # transform non-numerical labels (as long as they are hashable and comparable) to numerical labels\n lables = pickle.load(open(lable_file))\n le = preprocessing.LabelEncoder()\n le.fit(lables)\n lables = le.transform(lables)\n # print le.inverse_transform([0])\n\n ### text vectorization--go from strings to lists of numbers\n vectorizer = TfidfVectorizer(sublinear_tf=True, max_df=0.5, min_df=1,\n stop_words='english')\n features_train_transformed = vectorizer.fit_transform(features)\n\n # selector : SelectPercentile\n selector = SelectPercentile(f_classif, percentile=k)\n selector.fit(features_train_transformed, lables)\n\n # selector : SelectKBest\n # selector = SelectKBest(k=k)\n # selector.fit(features_train_transformed, lables)\n\n # selector : chi2\n # selector = SelectPercentile(score_func=chi2)\n # selector.fit(features_train_transformed, lables)\n\n features_train_transformed = selector.transform(features_train_transformed).toarray()\n\n return features_train_transformed, lables, vectorizer, selector, le, features", "metadata": "root.preprocess", "header": "['module', '___EOS___']", "index": 43 } ]
[ { "span": "from sklearn.cross_validation import KFold", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 42 }, { "span": "from sklearn.linear_model import LinearRegression, ElasticNet, Lasso, Ridge, ElasticNetCV", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 89 }, { "span": "from sklearn.feature_selection import SelectPercentile, f_classif, chi2", "start_line": 8, "start_column": 0, "end_line": 8, "end_column": 71 }, { "span": "from sklearn.feature_selection import SelectKBest, f_regression", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 63 } ]
[]
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_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "cross", "\\u", "validation_", "import_", "KF", "old_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "linear", "\\u", "model_", "import_", "Linea", "r", "Regression_", ",_", "Elast", "ic", "Net_", ",_", "Las", "so_", ",_", "Rid", "ge_", ",_", "Elast", "ic", "Net", "CV_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "metrics_", "import_", "mean", "\\u", "square", "d\\u", "error_", ",_", "r2", "\\u", "score_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "time_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "feature", "\\u", "extraction_", "._", "text_", "import_", "Tf", "idf", "Vectorizer_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "feature", "\\u", "selection_", "import_", "Select", "Perce", "ntil", "e_", ",_", "f", "\\u", "classif", "_", ",_", "chi2_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "._", "feature", "\\u", "selection_", "import_", "Select", "KB", "est_", ",_", "f", "\\u", "regression_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "pickle_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "import_", "preprocessing_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sklearn_", "import_", "cross", "\\u", "validation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "matplotlib_", "._", "pyplot_", "as_", "plt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "itertools_", "import_", "cycle_", "\\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_", "n", "Features_", "=_", "np_", "._", "arange_", "(_", "10_", ",_", "40_", ",_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "k_", "in_", "n", "Features_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "features_", ",_", "labels_", ",_", "vectorizer", "_", ",_", "selector_", ",_", "le_", ",_", "features", "\\u", "data_", "=_", "preprocess_", "(_", "\"", "pkl", "/", "article", "\\u", "2", "\\u", "people", ".", "pkl", "\"_", ",_", "\"", "pkl", "/", "lable", "\\u", "2", "\\u", "people", ".", "pkl", "\"_", ",_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "features", "\\u", "train_", ",_", "features", "\\u", "test_", ",_", "labels", "\\u", "train_", ",_", "labels", "\\u", "test_", "=_", "cross", "\\u", "validation_", "._", "train", "\\u", "test\\u", "split_", "(_", "features_", ",_", "labels_", ",_", "test\\u", "size_", "=_", "0.1_", ",_", "random", "\\u", "state_", "=_", "42_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "name_", ",_", "clf_", "in_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "linear", " ", "regress", "ion", "'_", ",_", "Linea", "r", "Regression_", "(_", "fit", "\\u", "intercept_", "=_", "True_", ")_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "('", "lass", "o", "()'", ",", " ", "Las", "so", "())", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "('", "elastic", "-", "net", "(.", "5", ")'", ",", " ", "Elast", "ic", "Net", "(", "alpha", "=", "0.", "5", "))", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "('", "lass", "o", "(.", "5", ")'", ",", " ", "Las", "so", "(", "alpha", "=", "0.", "5", "))", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "('", "ridge", "(.", "5", ")'", ",", " ", "Rid", "ge", "(", "alpha", "=", "0.", "5", "))", "_", "\\u\\u\\uNL\\u\\u\\u_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "data_", "._", "has", "\\u", "key_", "(_", "name_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "[_", "name_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", "\"*\"_", "*_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "Meth", "od", ":", " ", "{}'_", "._", "format_", "(_", "name_", ")_", "+_", "'", " ", "the", " ", "number", " ", "of", " ", "feature", " ", "is", " ", "{}'_", "._", "format_", "(_", "k_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Fit", " ", "on", " ", "the", " ", "whole", " ", "data", ":_", "\\u\\u\\uNL\\u\\u\\u_", "t0_", "=_", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "clf_", "._", "fit_", "(_", "features", "\\u", "train_", ",_", "labels", "\\u", "train_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "train", "ing", " ", "time", ":\"_", ",_", "round_", "(_", "time_", "(_", ")_", "-_", "t0_", ",_", "3_", ")_", ",_", "\"", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Predic", "t", " ", "on", " ", "the", " ", "whole", " ", "data", ":_", "\\u\\u\\uNL\\u\\u\\u_", "y", "\\u", "pred_", "=_", "clf_", "._", "predict_", "(_", "features", "\\u", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "\"", "predicti", "ng", " ", "time", ":\"_", ",_", "round_", "(_", "time_", "(_", ")_", "-_", "t0_", ",_", "3_", ")_", ",_", "\"", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "score", "\\u", "accuracy_", "=_", "mean", "\\u", "square", "d\\u", "error_", "(_", "y", "\\u", "pred_", ",_", "labels", "\\u", "test_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "r2", " ", "score", " ", ":", " ", "{}'_", "._", "format_", "(_", "r2", "\\u", "score_", "(_", "y", "\\u", "pred_", ",_", "labels", "\\u", "test_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "(_", "'", "mean", " ", "square", "d", " ", "error", " ", ":", " ", "{}'_", "._", "format_", "(_", "score", "\\u", "accuracy_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "print_", "\"*\"_", "*_", "100_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "data_", "[_", "name_", "]_", "._", "append_", "(_", "score", "\\u", "accuracy_", ")_", "\\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_", "plot_", "(_", "n", "Features_", ",_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "data_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "plot_", "(_", "n", "Features_", ",_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "colors_", "=_", "cycle_", "(_", "'", "rgb", "cm", "yk", "w", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "algorithm_", "=_", "sorted_", "(_", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "fig_", "=_", "plt_", "._", "figure_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "=_", "fig_", "._", "add", "\\u", "subplot_", "(_", "111_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "for_", "j_", ",_", "c_", "in_", "zip_", "(_", "algorithm_", ",_", "colors_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "for", " ", "j", " ", "in", " ", "algo", "rit", "hm", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "plt", ".", "scatter", "(", "n", "Feature", "s", ",", " ", "data", "[", "j", "],", " ", "label", "=", "j", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ax_", "._", "plot_", "(_", "n", "Features_", ",_", "data_", "[_", "j_", "]_", ",_", "label_", "=_", "j_", ",_", "color_", "=_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "scatter_", "(_", "n", "Features_", ",_", "data_", "[_", "j_", "]_", ",_", "color_", "=_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "plt_", "._", "xlabel_", "(_", "\"#", "-", "Feature", "s", "(", "Select", "Perce", "ntil", "e", ")\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "ylabel_", "(_", "\"", "Mea", "n", " ", "Square", "d", " ", "Error", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "title_", "(_", "\"", "Mea", "n", " ", "Square", "d", " ", "Error", " ", "vs", " ", "#-", "Feature", "s", " ", "for", " ", "different", " ", "classif", "iers", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "ax", ".", "set\\u", "xs", "cale", "(\"", "log", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "box_", "=_", "ax_", "._", "get", "\\u", "position_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "set\\u", "position_", "(_", "[_", "box_", "._", "x0_", ",_", "box_", "._", "y0_", "+_", "box_", "._", "height_", "*_", "0.3_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "box_", "._", "width_", ",_", "box_", "._", "height_", "*_", "0.7_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "legend_", "(_", "loc_", "=_", "\"", "upper", " ", "center", "\"_", ",_", "bbox", "\\u", "to", "\\u", "anchor_", "=_", "(_", "0.5_", ",_", "-_", "0.15_", ")_", ",_", "fancy", "box_", "=_", "True_", ",_", "shadow_", "=_", "True_", ",_", "ncol_", "=_", "3_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "ax", ".", "set\\u", "ylim", "(", "0", ",", " ", "6.0", ")_", "\\u\\u\\uNL\\u\\u\\u_", "plt_", "._", "legend_", "(_", "loc_", "=_", "2_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plt_", "._", "show_", "(_", ")_", "\\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_", "preprocess_", "(_", "article", "\\u", "file_", ",_", "lable", "\\u", "file_", ",_", "k_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "features_", "=_", "pickle_", "._", "load_", "(_", "open_", "(_", "article", "\\u", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "features_", "=_", "np_", "._", "array_", "(_", "features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "transform", " ", "non", "-", "numerical", " ", "labels", " ", "(", "as", " ", "long", " ", "as", " ", "the", "y", " ", "are", " ", "hashable", " ", "and", " ", "compara", "ble", ")", " ", "to", " ", "numerical", " ", "labels_", "\\u\\u\\uNL\\u\\u\\u_", "lable", "s_", "=_", "pickle_", "._", "load_", "(_", "open_", "(_", "lable", "\\u", "file_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "le_", "=_", "preprocessing_", "._", "Label", "Encoder_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "le_", "._", "fit_", "(_", "lable", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "lable", "s_", "=_", "le_", "._", "transform_", "(_", "lable", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "print", " ", "le", ".", "inv", "erse", "\\u", "transform", "([", "0", "])", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "###", " ", "text", " ", "vector", "izatio", "n", "--", "go", " ", "from", " ", "string", "s", " ", "to", " ", "lists", " ", "of", " ", "numbers_", "\\u\\u\\uNL\\u\\u\\u_", "vectorizer", "_", "=_", "Tf", "idf", "Vectorizer_", "(_", "subli", "near", "\\u", "tf_", "=_", "True_", ",_", "max", "\\u", "df_", "=_", "0.5_", ",_", "min", "\\u", "df_", "=_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "stop", "\\u", "words_", "=_", "'", "english", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "features", "\\u", "train", "\\u", "transformed_", "=_", "vectorizer", "_", "._", "fit", "\\u", "transform_", "(_", "features_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "select", "or", " ", ":", " ", "Select", "Perce", "ntil", "e_", "\\u\\u\\uNL\\u\\u\\u_", "selector_", "=_", "Select", "Perce", "ntil", "e_", "(_", "f", "\\u", "classif", "_", ",_", "percentile_", "=_", "k_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "selector_", "._", "fit_", "(_", "features", "\\u", "train", "\\u", "transformed_", ",_", "lable", "s_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "select", "or", " ", ":", " ", "Select", "KB", "est_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "select", "or", " ", "=", " ", "Select", "KB", "est", "(", "k", "=", "k", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "select", "or", ".", "fit", "(", "features", "\\u", "train", "\\u", "transforme", "d", ",", " ", "lable", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "select", "or", " ", ":", " ", "chi2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "select", "or", " ", "=", " ", "Select", "Perce", "ntil", "e", "(", "score", "\\u", "func", "=", "chi", "2", ")_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "select", "or", ".", "fit", "(", "features", "\\u", "train", "\\u", "transforme", "d", ",", " ", "lable", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "features", "\\u", "train", "\\u", "transformed_", "=_", "selector_", "._", "transform_", "(_", "features", "\\u", "train", "\\u", "transformed_", ")_", "._", "toa", "rray_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "features", "\\u", "train", "\\u", "transformed_", ",_", "lable", "s_", ",_", "vectorizer", "_", ",_", "selector_", ",_", "le_", ",_", "features_", "\\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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 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: utf-8 -*-\n#\n# txtorcon documentation build configuration file, created by\n# sphinx-quickstart on Thu Jan 26 13:04:28 2012.\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys, os\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\nsys.path.insert(0, os.path.abspath('..'))\nsys.path.insert(0, os.path.abspath('.'))\n\n## we have a custom-changed alabaster theme...\nsys.path.insert(0, os.path.join(os.path.split(__file__)[0], '_themes'))\n\n# -- General configuration -----------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#needs_sphinx = '1.0'\n\n## trying to set t his somewhere...\nautodoc_member_order = 'bysource'\nautodoc_default_flags = ['members', 'show-inheritance', 'undoc-members']\nautoclass_content = 'both'\n\n# Add any Sphinx extension module names here, as strings. They can be extensions\n# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.\nextensions = ['sphinx.ext.autodoc',\n 'sphinx.ext.todo',\n 'sphinx.ext.autosummary',\n 'sphinx.ext.todo',\n 'sphinx.ext.coverage',\n 'repoze.sphinx.autointerface',\n 'apilinks_sphinxext'\n ]\n\ntodo_include_todos = True\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix of source filenames.\nsource_suffix = '.rst'\n\n# The encoding of source files.\n#source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'txtorcon'\ncopyright = u'2012, meejah@meejah.ca'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nfrom txtorcon._metadata import __version__\nversion = __version__\n# The full version, including alpha/beta/rc tags.\nrelease = __version__\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#language = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = ['_build']\n\n# The reST default role (used for this markup: `text`) to use for all documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n\n# -- Options for HTML output ---------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages. See the documentation for\n# a list of builtin themes.\nhtml_theme = 'default'\nhtml_theme = 'scrolls'\nhtml_theme = 'traditional'\nhtml_theme = 'nature'\nhtml_theme = 'pyramid'\nhtml_theme = 'agogo'\nhtml_theme = 'haiku'\nhtml_theme_options = {\n# 'stickysidebar': 'true',\n# 'rightsidebar':'true',\n 'nosidebar': 'false',\n# 'full_logo': 'false'\n 'sidebarwidth': '300'\n }\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further. For a list of options available for each theme, see the\n# documentation.\n#html_theme_options = {}\n\n## playing with alabaster, from https://github.com/bitprophet/alabaster\n\nimport alabaster\n\nhtml_theme_path = [alabaster.get_path()]\nextensions.append('alabaster')\nhtml_theme = 'alabaster'\nhtml_sidebars = {\n '**': [\n 'about.html', 'navigation.html', 'searchbox.html', 'donate.html',\n ]\n}\nhtml_theme_options = {\n 'logo': 'logo.svg',\n 'github_button': 'false',\n 'github_user': 'meejah',\n 'github_repo': 'txtorcon',\n 'travis_button': 'true',\n 'coveralls_button': 'true',\n 'logo_name': 'true',\n 'description': 'Control Tor from Twisted',\n 'logo_text_align': 'center',\n 'flattr_uri': 'http://flattr.com/thing/1689502/meejahtxtorcon-on-GitHub',\n 'note_bg': '#ccddcc',\n 'note_border': '#839496',\n}\n\n\n# The name for this set of Sphinx documents. If None, it defaults to\n# \"<project> v<release> documentation\".\nhtml_title = 'timaq4ygg2iegci7.onion: txtorcon documentation'\n\n# A shorter title for the navigation bar. Default is the same as html_title.\nhtml_short_title = 'txtorcon docs'\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n#html_logo = 'avatar.png'\n#html_logo = 'logo.png'\n#html_logo = 'logo.svg'\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n#html_favicon = None\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_last_updated_fmt = '%b %d, %Y'\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\nhtml_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\n#html_domain_indices = True\n\n# If false, no index is generated.\n#html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\nhtml_show_sourcelink = False\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\n#html_show_sphinx = True\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\nhtml_show_copyright = False\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it. The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# This is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = None\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'txtorcondoc'\n\n\n# -- Options for LaTeX output --------------------------------------------------\n\n# The paper size ('letter' or 'a4').\n#latex_paper_size = 'letter'\n\n# The font size ('10pt', '11pt' or '12pt').\n#latex_font_size = '10pt'\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title, author, documentclass [howto/manual]).\nlatex_documents = [\n ('index', 'txtorcon.tex', u'txtorcon Documentation',\n u'meejah', 'manual'),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# If true, show page references after internal links.\n#latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n#latex_show_urls = False\n\n# Additional stuff for the LaTeX preamble.\n#latex_preamble = ''\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_domain_indices = True\n\n\n# -- Options for manual page output --------------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n ('index', 'txtorcon', u'txtorcon Documentation',\n [u'meejah'], 1)\n]\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "html_theme ", "start_line": 112, "start_column": 0, "end_line": 112, "end_column": 10 }, { "span": "html_theme ", "start_line": 113, "start_column": 0, "end_line": 113, "end_column": 10 }, { "span": "html_theme ", "start_line": 114, "start_column": 0, "end_line": 114, "end_column": 10 }, { "span": "html_theme ", "start_line": 115, "start_column": 0, "end_line": 115, "end_column": 10 }, { "span": "html_theme ", "start_line": 116, "start_column": 0, "end_line": 116, "end_column": 10 }, { "span": "html_theme ", "start_line": 117, "start_column": 0, "end_line": 117, "end_column": 10 }, { "span": "html_theme ", "start_line": 118, "start_column": 0, "end_line": 118, "end_column": 10 }, { "span": "html_theme_options ", "start_line": 119, "start_column": 0, "end_line": 119, "end_column": 18 } ]
[ { "span": "html_theme ", "start_line": 138, "start_column": 0, "end_line": 138, "end_column": 10 }, { "span": "html_theme_options ", "start_line": 144, "start_column": 0, "end_line": 144, "end_column": 18 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "-*-", " ", "codi", "ng", ":", " ", "utf", "-", "8", " ", "-*-", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "txt", "orc", "on", " ", "documentation", " ", "build", " ", "configura", "tion", " ", "file", ",", " ", "created", " ", "by_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "sphinx", "-", "quicks", "tart", " ", "on", " ", "Thu", " ", "Jan", " ", "2", "6", " ", "13", ":", "04", ":", "2", "8", " ", "2012", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "file", " ", "is", " ", "execfile", "()", "d", " ", "with", " ", "the", " ", "current", " ", "director", "y", " ", "set", " ", "to", " ", "its", " ", "contain", "ing", " ", "dir", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Not", "e", " ", "tha", "t", " ", "not", " ", "all", " ", "possib", "le", " ", "configura", "tion", " ", "values", " ", "are", " ", "presen", "t", " ", "in", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "autogen", "erate", "d", " ", "file", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "All", " ", "configura", "tion", " ", "values", " ", "have", " ", "a", " ", "default", ";", " ", "values", " ", "tha", "t", " ", "are", " ", "commente", "d", " ", "out_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "serve", " ", "to", " ", "show", " ", "the", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "sys_", ",_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "extensi", "ons", " ", "(", "or", " ", "module", "s", " ", "to", " ", "document", " ", "with", " ", "autod", "oc", ")", " ", "are", " ", "in", " ", "anot", "her", " ", "director", "y", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "add", " ", "these", " ", "director", "ies", " ", "to", " ", "sys", ".", "path", " ", "here", ".", " ", "If", " ", "the", " ", "director", "y", " ", "is", " ", "relative", " ", "to", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", " ", "root", ",", " ", "use", " ", "os", ".", "path", ".", "abs", "path", " ", "to", " ", "make", " ", "it", " ", "abs", "olute", ",", " ", "like", " ", "shown", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "os_", "._", "path_", "._", "abspath_", "(_", "'..'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "os_", "._", "path_", "._", "abspath_", "(_", "'.'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "we", " ", "have", " ", "a", " ", "custom", "-", "change", "d", " ", "ala", "bast", "er", " ", "them", "e", "..._", "\\u\\u\\uNL\\u\\u\\u_", "sys_", "._", "path_", "._", "insert_", "(_", "0_", ",_", "os_", "._", "path_", "._", "join_", "(_", "os_", "._", "path_", "._", "split_", "(_", "\\u\\u", "file\\u\\u_", ")_", "[_", "0_", "]_", ",_", "'\\u", "themes", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "General", " ", "configura", "tion", " ", "--------------", "--------------", "--------------", "-----------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "your", " ", "documentation", " ", "need", "s", " ", "a", " ", "minima", "l", " ", "Sph", "inx", " ", "version", ",", " ", "state", " ", "it", " ", "here", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "need", "s", "\\u", "sphinx", " ", "=", " ", "'", "1.0", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "try", "ing", " ", "to", " ", "set", " ", "t", " ", "his", " ", "some", "where", "..._", "\\u\\u\\uNL\\u\\u\\u_", "autod", "oc", "\\u", "member", "\\u", "order_", "=_", "'", "bys", "ource", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "autod", "oc", "\\u", "default", "\\u", "flags_", "=_", "[_", "'", "member", "s", "'_", ",_", "'", "show", "-", "inherita", "nce", "'_", ",_", "'", "undo", "c", "-", "member", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "autocl", "ass", "\\u", "content_", "=_", "'", "bot", "h", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "Sph", "inx", " ", "extensi", "on", " ", "module", " ", "names", " ", "here", ",", " ", "as", " ", "string", "s", ".", " ", "The", "y", " ", "can", " ", "be", " ", "extensions_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "comi", "ng", " ", "with", " ", "Sph", "inx", " ", "(", "named", " ", "'", "sphinx", ".", "ext", ".*", "')", " ", "or", " ", "your", " ", "custom", " ", "ones", "._", "\\u\\u\\uNL\\u\\u\\u_", "extensions_", "=_", "[_", "'", "sphinx", ".", "ext", ".", "autod", "oc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "todo", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "autosu", "mmar", "y", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "todo", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sphinx", ".", "ext", ".", "covera", "ge", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "repo", "ze", ".", "sphinx", ".", "autoi", "nter", "face", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "api", "link", "s", "\\u", "sphinx", "ext", "'_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "todo", "\\u", "include", "\\u", "todos_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "template", "s", " ", "here", ",", " ", "relative", " ", "to", " ", "this", " ", "director", "y", "._", "\\u\\u\\uNL\\u\\u\\u_", "template", "s", "\\u", "path_", "=_", "[_", "'\\u", "template", "s", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "suff", "ix", " ", "of", " ", "source", " ", "filename", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "source", "\\u", "suffix_", "=_", "'.", "rst", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "encoding", " ", "of", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "source", "\\u", "encoding", " ", "=", " ", "'", "utf", "-", "8", "-", "sig", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "master", " ", "toc", "tree", " ", "document", "._", "\\u\\u\\uNL\\u\\u\\u_", "master", "\\u", "doc_", "=_", "'", "index", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "General", " ", "informati", "on", " ", "abo", "ut", " ", "the", " ", "project", "._", "\\u\\u\\uNL\\u\\u\\u_", "project_", "=_", "u", "'", "txt", "orc", "on", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "copyright_", "=_", "u", "'", "2012", ",", " ", "mee", "ja", "h", "@", "mee", "ja", "h", ".", "ca", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "version", " ", "info", " ", "for", " ", "the", " ", "project", " ", "you", "'", "re", " ", "document", "ing", ",", " ", "acts", " ", "as", " ", "replace", "ment", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "|", "version", "|", " ", "and", " ", "|", "release", "|", ",", " ", "als", "o", " ", "used", " ", "in", " ", "vari", "ous", " ", "other", " ", "place", "s", " ", "through", "out", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "bui", "lt", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "short", " ", "X", ".", "Y", " ", "version", "._", "\\u\\u\\uNL\\u\\u\\u_", "from_", "txt", "orc", "on_", "._", "\\u", "metadata_", "import_", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "version_", "=_", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "full", " ", "version", ",", " ", "inclu", "ding", " ", "alpha", "/", "beta", "/", "rc", " ", "tags", "._", "\\u\\u\\uNL\\u\\u\\u_", "release_", "=_", "\\u\\u", "version\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "language", " ", "for", " ", "content", " ", "autogen", "erate", "d", " ", "by", " ", "Sph", "inx", ".", " ", "Refer", " ", "to", " ", "documentation", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "a", " ", "list", " ", "of", " ", "support", "ed", " ", "language", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "language", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "There", " ", "are", " ", "two", " ", "options", " ", "for", " ", "repla", "cing", " ", "|", "toda", "y", "|", ":", " ", "eit", "her", ",", " ", "you", " ", "set", " ", "toda", "y", " ", "to", " ", "some", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "non", "-", "fal", "se", " ", "value", ",", " ", "then", " ", "it", " ", "is", " ", "used", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Else", ",", " ", "toda", "y", "\\u", "fmt", " ", "is", " ", "used", " ", "as", " ", "the", " ", "format", " ", "for", " ", "a", " ", "strf", "time", " ", "call", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "toda", "y", "\\u", "fmt", " ", "=", " ", "'%", "B", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "List", " ", "of", " ", "pattern", "s", ",", " ", "relative", " ", "to", " ", "source", " ", "director", "y", ",", " ", "tha", "t", " ", "match", " ", "files", " ", "and_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "director", "ies", " ", "to", " ", "ignore", " ", "whe", "n", " ", "look", "ing", " ", "for", " ", "source", " ", "files", "._", "\\u\\u\\uNL\\u\\u\\u_", "exclu", "de", "\\u", "patterns_", "=_", "[_", "'\\u", "build", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "re", "ST", " ", "default", " ", "role", " ", "(", "used", " ", "for", " ", "this", " ", "markup", ":", " ", "`", "text", "`)", " ", "to", " ", "use", " ", "for", " ", "all", " ", "document", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "default", "\\u", "role", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "'(", ")'", " ", "will", " ", "be", " ", "append", "ed", " ", "to", " ", ":", "func", ":", " ", "etc", ".", " ", "cross", "-", "reference", " ", "text", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "function", "\\u", "parenthes", "es", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "current", " ", "module", " ", "name", " ", "will", " ", "be", " ", "prepend", "ed", " ", "to", " ", "all", " ", "description_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "unit", " ", "titles", " ", "(", "suc", "h", " ", "as", " ", "..", " ", "function", "::", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "add", "\\u", "module", "\\u", "names", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "section", "author", " ", "and", " ", "module", "author", " ", "directive", "s", " ", "will", " ", "be", " ", "shown", " ", "in", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "output", ".", " ", "The", "y", " ", "are", " ", "ignore", "d", " ", "by", " ", "default", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "show", "\\u", "author", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "the", " ", "Pyg", "ment", "s", " ", "(", "synta", "x", " ", "highlight", "ing", ")", " ", "style", " ", "to", " ", "use", "._", "\\u\\u\\uNL\\u\\u\\u_", "pyg", "ment", "s", "\\u", "style_", "=_", "'", "sphinx", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "list", " ", "of", " ", "ignore", "d", " ", "prefix", "es", " ", "for", " ", "module", " ", "index", " ", "sorting", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "modi", "nde", "x", "\\u", "common", "\\u", "prefix", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "HTM", "L", " ", "output", " ", "--------------", "--------------", "--------------", "---------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "them", "e", " ", "to", " ", "use", " ", "for", " ", "HTM", "L", " ", "and", " ", "HTM", "L", " ", "Help", " ", "page", "s", ".", " ", " ", "See", " ", "the", " ", "documentation", " ", "for_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "a", " ", "list", " ", "of", " ", "bui", "lti", "n", " ", "themes", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "default", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "scroll", "s", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "trad", "itional", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "natur", "e", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "pyram", "id", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "ago", "go", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "hai", "ku", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "\\u", "them", "e\\u", "options_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "'", "sticky", "sidebar", "':", " ", "'", "true", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", "'", "rights", "ide", "bar", "':", "'", "true", "',", "_", "\\u\\u\\uNL\\u\\u\\u_", "'", "nos", "ide", "bar", "'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "'", "full", "\\u", "logo", "':", " ", "'", "fal", "se", "'_", "\\u\\u\\uNL\\u\\u\\u_", "'", "sidebar", "widt", "h", "'_", ":_", "'", "300", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Them", "e", " ", "options", " ", "are", " ", "them", "e-", "specific", " ", "and", " ", "customize", " ", "the", " ", "look", " ", "and", " ", "feel", " ", "of", " ", "a", " ", "theme_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "fur", "ther", ".", " ", " ", "For", " ", "a", " ", "list", " ", "of", " ", "options", " ", "avail", "able", " ", "for", " ", "each", " ", "them", "e", ",", " ", "see", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "documentation", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "them", "e\\u", "options", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "##", " ", "play", "ing", " ", "with", " ", "ala", "bast", "er", ",", " ", "from", " ", "https", "://", "git", "hub", ".", "com", "/", "bit", "prop", "het", "/", "ala", "bast", "er_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "ala", "bast", "er_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "them", "e\\u", "path_", "=_", "[_", "ala", "bast", "er_", "._", "get", "\\u", "path_", "(_", ")_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "extensions_", "._", "append_", "(_", "'", "ala", "bast", "er", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "\\u", "theme_", "=_", "'", "ala", "bast", "er", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "\\u", "sidebar", "s_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'**", "'_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "'", "abo", "ut", ".", "html", "'_", ",_", "'", "navigation", ".", "html", "'_", ",_", "'", "search", "box", ".", "html", "'_", ",_", "'", "dona", "te", ".", "html", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "html", "\\u", "them", "e\\u", "options_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "logo", "'_", ":_", "'", "logo", ".", "svg", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "git", "hub", "\\u", "button", "'_", ":_", "'", "fal", "se", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "git", "hub", "\\u", "user", "'_", ":_", "'", "mee", "ja", "h", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "git", "hub", "\\u", "repo", "'_", ":_", "'", "txt", "orc", "on", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "travis", "\\u", "button", "'_", ":_", "'", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "covera", "lls", "\\u", "button", "'_", ":_", "'", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "logo", "\\u", "name", "'_", ":_", "'", "true", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "description", "'_", ":_", "'", "Control", " ", "Tor", " ", "from", " ", "Twi", "sted", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "logo", "\\u", "text", "\\u", "align", "'_", ":_", "'", "center", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "flat", "tr", "\\u", "uri", "'_", ":_", "'", "http", "://", "flat", "tr", ".", "com", "/", "thing", "/", "168", "950", "2", "/", "mee", "ja", "ht", "xt", "orc", "on", "-", "on", "-", "Git", "Hub", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "note", "\\u", "bg", "'_", ":_", "'#", "ccd", "dcc", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "note", "\\u", "border", "'_", ":_", "'#", "839", "496", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "for", " ", "this", " ", "set", " ", "of", " ", "Sph", "inx", " ", "document", "s", ".", " ", " ", "If", " ", "Non", "e", ",", " ", "it", " ", "default", "s", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "\"<", "project", ">", " ", "v", "<", "release", ">", " ", "documentation", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "title_", "=_", "'", "tim", "aq", "4", "yg", "g2", "ie", "gc", "i", "7", ".", "onion", ":", " ", "txt", "orc", "on", " ", "documentation", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "A", " ", "shorter", " ", "title", " ", "for", " ", "the", " ", "navigation", " ", "bar", ".", " ", " ", "Default", " ", "is", " ", "the", " ", "same", " ", "as", " ", "html", "\\u", "title", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "short", "\\u", "title_", "=_", "'", "txt", "orc", "on", " ", "docs", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "of", " ", "the", " ", "sidebar", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "logo", " ", "=", " ", "'", "avat", "ar", ".", "png", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "logo", " ", "=", " ", "'", "logo", ".", "png", "'_", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "logo", " ", "=", " ", "'", "logo", ".", "svg", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "within", " ", "the", " ", "static", " ", "path", ")", " ", "to", " ", "use", " ", "as", " ", "fav", "icon", " ", "of", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "docs", ".", " ", " ", "Thi", "s", " ", "file", " ", "shou", "ld", " ", "be", " ", "a", " ", "Window", "s", " ", "icon", " ", "file", " ", "(.", "ico", ")", " ", "bei", "ng", " ", "16", "x1", "6", " ", "or", " ", "32", "x3", "2_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pixel", "s", " ", "large", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "fav", "icon", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Add", " ", "any", " ", "path", "s", " ", "tha", "t", " ", "contain", " ", "custom", " ", "static", " ", "files", " ", "(", "suc", "h", " ", "as", " ", "style", " ", "sheet", "s", ")", " ", "here", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "relative", " ", "to", " ", "this", " ", "director", "y", ".", " ", "The", "y", " ", "are", " ", "copie", "d", " ", "after", " ", "the", " ", "bui", "lti", "n", " ", "static", " ", "files", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "so", " ", "a", " ", "file", " ", "named", " ", "\"", "default", ".", "css", "\"", " ", "will", " ", "overwrit", "e", " ", "the", " ", "bui", "lti", "n", " ", "\"", "default", ".", "css", "\".", "_", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "static", "\\u", "path_", "=_", "[_", "'\\u", "static", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "not", " ", "''", ",", " ", "a", " ", "'", "Las", "t", " ", "update", "d", " ", "on", ":'", " ", "timestamp", " ", "is", " ", "inserted", " ", "at", " ", "every", " ", "page", " ", "bottom", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "usi", "ng", " ", "the", " ", "give", "n", " ", "strf", "time", " ", "format", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "last", "\\u", "update", "d\\u", "fmt", " ", "=", " ", "'%", "b", " ", "%", "d", ",", " ", "%", "Y", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "Sma", "rty", "Pant", "s", " ", "will", " ", "be", " ", "used", " ", "to", " ", "convert", " ", "quote", "s", " ", "and", " ", "dashes", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "typo", "graphical", "ly", " ", "correct", " ", "entit", "ies", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "use", "\\u", "smart", "ypa", "nts_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Custom", " ", "sidebar", " ", "template", "s", ",", " ", "maps", " ", "document", " ", "names", " ", "to", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "sidebar", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "template", "s", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "render", "ed", " ", "to", " ", "page", "s", ",", " ", "maps", " ", "page", " ", "names", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "template", " ", "names", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "addition", "al", "\\u", "page", "s", " ", "=", " ", "{}", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "index", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "the", " ", "index", " ", "is", " ", "split", " ", "int", "o", " ", "individual", " ", "page", "s", " ", "for", " ", "each", " ", "letter", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "split", "\\u", "index", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "link", "s", " ", "to", " ", "the", " ", "re", "ST", " ", "source", "s", " ", "are", " ", "adde", "d", " ", "to", " ", "the", " ", "page", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "show", "\\u", "source", "link_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"", "Creat", "ed", " ", "usi", "ng", " ", "Sph", "inx", "\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "show", "\\u", "sphinx", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "\"(", "C", ")", " ", "Copy", "right", " ", "...\"", " ", "is", " ", "shown", " ", "in", " ", "the", " ", "HTM", "L", " ", "footer", ".", " ", "Default", " ", "is", " ", "Tru", "e", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "\\u", "show", "\\u", "copyright_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "an", " ", "Open", "Sear", "ch", " ", "description", " ", "file", " ", "will", " ", "be", " ", "output", ",", " ", "and", " ", "all", " ", "page", "s", " ", "will", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "contain", " ", "a", " ", "<", "link", ">", " ", "tag", " ", "refer", "ring", " ", "to", " ", "it", ".", " ", " ", "The", " ", "value", " ", "of", " ", "this", " ", "option", " ", "must", " ", "be", " ", "the_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "base", " ", "URL", " ", "from", " ", "whi", "ch", " ", "the", " ", "finish", "ed", " ", "HTM", "L", " ", "is", " ", "serve", "d", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "use", "\\u", "opens", "ear", "ch", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "the", " ", "file", " ", "name", " ", "suff", "ix", " ", "for", " ", "HTM", "L", " ", "files", " ", "(", "e", ".", "g", ".", " ", "\".", "xh", "tml", "\")", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "html", "\\u", "file", "\\u", "suff", "ix", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Output", " ", "file", " ", "base", " ", "name", " ", "for", " ", "HTM", "L", " ", "help", " ", "builde", "r", "._", "\\u\\u\\uNL\\u\\u\\u_", "html", "help", "\\u", "basename_", "=_", "'", "txt", "orc", "ond", "oc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "La", "Te", "X", " ", "output", " ", "--------------", "--------------", "--------------", "--------", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "pape", "r", " ", "size", " ", "('", "letter", "'", " ", "or", " ", "'", "a4", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "pape", "r", "\\u", "size", " ", "=", " ", "'", "letter", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "font", " ", "size", " ", "('", "10", "pt", "',", " ", "'", "11", "pt", "'", " ", "or", " ", "'", "1", "2p", "t", "')", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "font", "\\u", "size", " ", "=", " ", "'", "10", "pt", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Group", "ing", " ", "the", " ", "document", " ", "tree", " ", "int", "o", " ", "La", "Te", "X", " ", "files", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "target", " ", "name", ",", " ", "title", ",", " ", "author", ",", " ", "document", "class", " ", "[", "how", "to", "/", "manu", "al", "])", "._", "\\u\\u\\uNL\\u\\u\\u_", "late", "x", "\\u", "documents_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "txt", "orc", "on", ".", "tex", "'_", ",_", "u", "'", "txt", "orc", "on", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "u", "'", "mee", "ja", "h", "'_", ",_", "'", "manu", "al", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "name", " ", "of", " ", "an", " ", "image", " ", "file", " ", "(", "relative", " ", "to", " ", "this", " ", "director", "y", ")", " ", "to", " ", "place", " ", "at", " ", "the", " ", "top", " ", "of_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", " ", "title", " ", "page", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "logo", " ", "=", " ", "None_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "For", " ", "\"", "manu", "al", "\"", " ", "document", "s", ",", " ", "if", " ", "this", " ", "is", " ", "true", ",", " ", "then", " ", "toplevel", " ", "heading", "s", " ", "are", " ", "part", "s", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "chapters", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "use", "\\u", "part", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "page", " ", "reference", "s", " ", "after", " ", "internal", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "show", "\\u", "pager", "ef", "s", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "true", ",", " ", "show", " ", "URL", " ", "addresse", "s", " ", "after", " ", "external", " ", "link", "s", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "show", "\\u", "urls", " ", "=", " ", "False_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Addition", "al", " ", "stu", "ff", " ", "for", " ", "the", " ", "La", "Te", "X", " ", "preamble", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "preamble", " ", "=", " ", "''_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Document", "s", " ", "to", " ", "append", " ", "as", " ", "an", " ", "appendi", "x", " ", "to", " ", "all", " ", "manu", "als", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "appendi", "ces", " ", "=", " ", "[]", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "If", " ", "fal", "se", ",", " ", "no", " ", "module", " ", "index", " ", "is", " ", "generat", "ed", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", "late", "x", "\\u", "domain", "\\u", "indice", "s", " ", "=", " ", "True_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "--", " ", "Optio", "ns", " ", "for", " ", "manu", "al", " ", "page", " ", "output", " ", "--------------", "--------------", "--------------", "--", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "One", " ", "entry", " ", "per", " ", "manu", "al", " ", "page", ".", " ", "List", " ", "of", " ", "tuples_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "(", "source", " ", "start", " ", "file", ",", " ", "name", ",", " ", "description", ",", " ", "author", "s", ",", " ", "manu", "al", " ", "section", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "man", "\\u", "pages_", "=_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "'", "index", "'_", ",_", "'", "txt", "orc", "on", "'_", ",_", "u", "'", "txt", "orc", "on", " ", "Document", "ation", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "[_", "u", "'", "mee", "ja", "h", "'_", "]_", ",_", "1_", ")_", "\\u\\u\\uNL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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unreachable code
celery/kombu/kombu/__init__.py
[ { "content": "\"\"\"Messaging library for Python\"\"\"\nfrom __future__ import absolute_import, unicode_literals\n\nimport os\nimport sys\n\nfrom collections import namedtuple\n\nversion_info_t = namedtuple(\n 'version_info_t', ('major', 'minor', 'micro', 'releaselevel', 'serial'),\n)\n\nVERSION = version_info = version_info_t(4, 0, 0, 'a1', '')\n__version__ = '{0.major}.{0.minor}.{0.micro}{0.releaselevel}'.format(VERSION)\n__author__ = 'Ask Solem'\n__contact__ = 'ask@celeryproject.org'\n__homepage__ = 'http://kombu.readthedocs.org'\n__docformat__ = 'restructuredtext en'\n\n# -eof meta-\n\nif sys.version_info < (2, 7): # pragma: no cover\n raise Exception('Kombu 4.0 requires Python versions 2.7 or later.')\n\nSTATICA_HACK = True\nglobals()['kcah_acitats'[::-1].upper()] = False\nif STATICA_HACK: # pragma: no cover\n # This is never executed, but tricks static analyzers (PyDev, PyCharm,\n # pylint, etc.) into knowing the types of these symbols, and what\n # they contain.\n from kombu.connection import Connection, BrokerConnection # noqa\n from kombu.entity import Exchange, Queue, binding # noqa\n from kombu.messaging import Consumer, Producer # noqa\n from kombu.pools import connections, producers # noqa\n from kombu.utils.url import parse_url # noqa\n from kombu.common import eventloop, uuid # noqa\n from kombu.serialization import ( # noqa\n enable_insecure_serializers,\n disable_insecure_serializers,\n )\n\n# Lazy loading.\n# - See werkzeug/__init__.py for the rationale behind this.\nfrom types import ModuleType # noqa\n\nall_by_module = {\n 'kombu.connection': ['Connection', 'BrokerConnection'],\n 'kombu.entity': ['Exchange', 'Queue', 'binding'],\n 'kombu.messaging': ['Consumer', 'Producer'],\n 'kombu.pools': ['connections', 'producers'],\n 'kombu.utils.url': ['parse_url'],\n 'kombu.common': ['eventloop', 'uuid'],\n 'kombu.serialization': ['enable_insecure_serializers',\n 'disable_insecure_serializers'],\n}\n\nobject_origins = {}\nfor module, items in all_by_module.items():\n for item in items:\n object_origins[item] = module\n\n\n\n# 2.5 does not define __package__\ntry:\n package = __package__\nexcept NameError: # pragma: no cover\n package = 'kombu'\n\n# keep a reference to this module so that it's not garbage collected\nold_module = sys.modules[__name__]\n\nnew_module = sys.modules[__name__] = module(__name__)\nnew_module.__dict__.update({\n '__file__': __file__,\n '__path__': __path__,\n '__doc__': __doc__,\n '__all__': tuple(object_origins),\n '__version__': __version__,\n '__author__': __author__,\n '__contact__': __contact__,\n '__homepage__': __homepage__,\n '__docformat__': __docformat__,\n '__package__': package,\n 'version_info_t': version_info_t,\n 'version_info': version_info,\n 'VERSION': VERSION,\n 'absolute_import': absolute_import,\n 'unicode_literals': unicode_literals,\n})\n\nif os.environ.get('KOMBU_LOG_DEBUG'): # pragma: no cover\n os.environ.update(KOMBU_LOG_CHANNEL='1', KOMBU_LOG_CONNECTION='1')\n from .utils import debug\n debug.setup_logging()\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 } ]
[ { "span": "except NameError: ", "start_line": 83, "start_column": 0, "end_line": 83, "end_column": 17 } ]
[]
1
true
[ "[CLS]_", "Unrea", "chab", "le_", "code_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "Messag", "ing", " ", "librar", "y", " ", "for", " ", "Pyth", "on", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "\\u\\u", "future\\u\\u_", "import_", "abs", "olute", "\\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_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "collections_", "import_", "namedtuple_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "version", "\\u", "info", "\\u", "t_", "=_", "namedtuple_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "version", "\\u", "info", "\\u", "t", "'_", ",_", "(_", "'", "major", "'_", ",_", "'", "mino", "r", "'_", ",_", "'", "micro", "'_", ",_", "'", "release", "level", "'_", ",_", "'", "serial", "'_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "VERSION_", "=_", "version", "\\u", "info_", "=_", "version", "\\u", "info", "\\u", "t_", "(_", "4_", ",_", "0_", ",_", "0_", ",_", "'", "a1", "'_", ",_", "''_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "version\\u\\u_", "=_", "'{", "0.", "major", "}.", "{", "0.", "mino", "r", "}.", "{", "0.", "micro", "}{", "0.", "release", "level", "}'_", "._", "format_", "(_", "VERSION_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "author\\u\\u_", "=_", "'", "As", "k", " ", "Sol", "em", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "contact", "\\u\\u_", "=_", "'", "ask", "@", "celery", "project", ".", "org", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "home", "page", "\\u\\u_", "=_", "'", "http", "://", "kom", "bu", ".", "read", "the", "docs", ".", "org", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u", "docformat", "\\u\\u_", "=_", "'", "restructur", "edt", "ext", " ", "en", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", "eof", " ", "meta", "-_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "sys_", "._", "version", "\\u", "info_", "<_", "(_", "2_", ",_", "7_", ")_", ":_", "#", " ", "pragma", ":", " ", "no", " ", "cover_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Exception_", "(_", "'", "Ko", "mbu", " ", "4.0", " ", "require", "s", " ", "Pyth", "on", " ", "version", "s", " ", "2.7", " ", "or", " ", "late", "r", ".'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "STATI", "CA", "\\u", "HA", "CK_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "globals_", "(_", ")_", "[_", "'", "kc", "ah", "\\u", "aci", "tats", "'_", "[_", ":_", ":_", "-_", "1_", "]_", "._", "upper_", "(_", ")_", "]_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "STATI", "CA", "\\u", "HA", "CK_", ":_", "#", " ", "pragma", ":", " ", "no", " ", "cover_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "is", " ", "neve", "r", " ", "executed", ",", " ", "but", " ", "trick", "s", " ", "static", " ", "analyze", "rs", " ", "(", "Py", "Dev", ",", " ", "Py", "Char", "m", ",_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "pylint", ",", " ", "etc", ".)", " ", "int", "o", " ", "know", "ing", " ", "the", " ", "types", " ", "of", " ", "these", " ", "symbols", ",", " ", "and", " ", "what_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "the", "y", " ", "contain", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "kom", "bu", "_", "._", "connection_", "import_", "Connection_", ",_", "Broker", "Connection_", "#", " ", "no", "qa_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kom", "bu", "_", "._", "entity_", "import_", "Exchange_", ",_", "Queue_", ",_", "binding_", "#", " ", "no", "qa_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kom", "bu", "_", "._", "messaging_", "import_", "Consumer_", ",_", "Producer_", "#", " ", "no", "qa_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kom", "bu", "_", "._", "pools_", "import_", "connections_", ",_", "producer", "s_", "#", " ", "no", "qa_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kom", "bu", "_", "._", "utils_", "._", "url_", "import_", "parse", "\\u", "url_", "#", " ", "no", "qa_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kom", "bu", "_", "._", "common_", "import_", "eventl", "oop", "_", ",_", "uuid_", "#", " ", "no", "qa_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "kom", "bu", "_", "._", "serialization_", "import_", "(_", "#", " ", "no", "qa_", "\\u\\u\\uNL\\u\\u\\u_", "enable", "\\u", "insecure", "\\u", "serializers_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "disable", "\\u", "insecure", "\\u", "serializers_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "La", "zy", " ", "load", "ing", "._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "-", " ", "See", " ", "werk", "zeu", "g", "/\\u", "\\u", "init", "\\u\\u", ".", "py", " ", "for", " ", "the", " ", "rational", "e", " ", "beh", "ind", " ", "this", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "from_", "types_", "import_", "Modul", "e", "Type_", "#", " ", "no", "qa_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "all", "\\u", "by", "\\u", "module_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kom", "bu", ".", "connecti", "on", "'_", ":_", "[_", "'", "Connect", "ion", "'_", ",_", "'", "Broker", "Connect", "ion", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kom", "bu", ".", "entity", "'_", ":_", "[_", "'", "Exc", "hange", "'_", ",_", "'", "Queue", "'_", ",_", "'", "bindi", "ng", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kom", "bu", ".", "mess", "agin", "g", "'_", ":_", "[_", "'", "Consume", "r", "'_", ",_", "'", "Producer", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kom", "bu", ".", "pools", "'_", ":_", "[_", "'", "connections", "'_", ",_", "'", "producer", "s", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kom", "bu", ".", "util", "s", ".", "url", "'_", ":_", "[_", "'", "parse", "\\u", "url", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kom", "bu", ".", "common", "'_", ":_", "[_", "'", "eventl", "oop", "'_", ",_", "'", "uuid", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "kom", "bu", ".", "serializ", "ation", "'_", ":_", "[_", "'", "enable", "\\u", "insecure", "\\u", "serialize", "rs", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "disable", "\\u", "insecure", "\\u", "serialize", "rs", "'_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "object\\u", "origins", "_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "module_", ",_", "items_", "in_", "all", "\\u", "by", "\\u", "module_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "item_", "in_", "items_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "object\\u", "origins", "_", "[_", "item_", "]_", "=_", "module_", "\\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_", "#", " ", "2.5", " ", "doe", "s", " ", "not", " ", "defin", "e", " ", "\\u\\u", "package", "\\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 ", " _", "package_", "=_", "\\u\\u", "package", "\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Name", "Error_", ":_", "#", " ", "pragma", ":", " ", "no", " ", "cover_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "package_", "=_", "'", "kom", "bu", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "keep", " ", "a", " ", "reference", " ", "to", " ", "this", " ", "module", " ", "so", " ", "tha", "t", " ", "it", "'", "s", " ", "not", " ", "gar", "bage", " ", "collected", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "old", "\\u", "module_", "=_", "sys_", "._", "modules_", "[_", "\\u\\u", "name\\u\\u_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "module_", "=_", "sys_", "._", "modules_", "[_", "\\u\\u", "name\\u\\u_", "]_", "=_", "module_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "new", "\\u", "module_", "._", "\\u\\u", "dict\\u\\u_", "._", "update_", "(_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "file", "\\u\\u'_", ":_", "\\u\\u", "file\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "path", "\\u\\u'_", ":_", "\\u\\u", "path\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "doc", "\\u\\u'_", ":_", "\\u\\u", "doc\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "all", "\\u\\u'_", ":_", "tuple_", "(_", "object\\u", "origins", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "version", "\\u\\u'_", ":_", "\\u\\u", "version\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "author", "\\u\\u'_", ":_", "\\u\\u", "author\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "contact", "\\u\\u'_", ":_", "\\u\\u", "contact", "\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "home", "page", "\\u\\u'_", ":_", "\\u\\u", "home", "page", "\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "docformat", "\\u\\u'_", ":_", "\\u\\u", "docformat", "\\u\\u_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'\\u", "\\u", "package", "\\u\\u'_", ":_", "package_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "version", "\\u", "info", "\\u", "t", "'_", ":_", "version", "\\u", "info", "\\u", "t_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "version", "\\u", "info", "'_", ":_", "version", "\\u", "info_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "VERSI", "ON", "'_", ":_", "VERSION_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "abs", "olute", "\\u", "import", "'_", ":_", "abs", "olute", "\\u", "import_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "unicode", "\\u", "literal", "s", "'_", ":_", "unicode", "\\u", "literals_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "os_", "._", "environ_", "._", "get_", "(_", "'", "KO", "MB", "U", "\\u", "LOG", "\\u", "DEBU", "G", "'_", ")_", ":_", "#", " ", "pragma", ":", " ", "no", " ", "cover_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "os_", "._", "environ_", "._", "update_", "(_", "KO", "MB", "U", "\\u", "LOG", "\\u", "CHANNEL_", "=_", "'", "1", "'_", ",_", "KO", "MB", "U", "\\u", "LOG", "\\u", "CONNECTION", "_", "=_", "'", "1", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "._", "utils_", "import_", "debug_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "debug_", "._", "setup", "\\u", "logging_", "(_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_" ]
[ 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 ]
Variable defined multiple times
rougier/freetype-py/examples/wordle.py
[ { "content": "def make_label(text, filename, size=12, angle=0):\n '''\n Parameters:\n -----------\n text : string\n Text to be displayed\n filename : string\n Path to a font\n size : int\n Font size in 1/64th points\n angle : float\n Text angle in degrees\n '''\n face = Face(filename)\n face.set_char_size( size*64 )\n angle = (angle/180.0)*math.pi\n matrix = FT_Matrix( (int)( math.cos( angle ) * 0x10000 ),\n (int)(-math.sin( angle ) * 0x10000 ),\n (int)( math.sin( angle ) * 0x10000 ),\n (int)( math.cos( angle ) * 0x10000 ))\n flags = FT_LOAD_RENDER\n pen = FT_Vector(0,0)\n FT_Set_Transform( face._FT_Face, byref(matrix), byref(pen) )\n previous = 0\n xmin, xmax = 0, 0\n ymin, ymax = 0, 0\n for c in text:\n face.load_char(c, flags)\n kerning = face.get_kerning(previous, c)\n previous = c\n bitmap = face.glyph.bitmap\n pitch = face.glyph.bitmap.pitch\n width = face.glyph.bitmap.width\n rows = face.glyph.bitmap.rows\n top = face.glyph.bitmap_top\n left = face.glyph.bitmap_left\n pen.x += kerning.x\n x0 = (pen.x >> 6) + left\n x1 = x0 + width\n y0 = (pen.y >> 6) - (rows - top)\n y1 = y0 + rows\n xmin, xmax = min(xmin, x0), max(xmax, x1)\n ymin, ymax = min(ymin, y0), max(ymax, y1)\n pen.x += face.glyph.advance.x\n pen.y += face.glyph.advance.y\n\n L = np.zeros((ymax-ymin, xmax-xmin),dtype=np.ubyte)\n previous = 0\n pen.x, pen.y = 0, 0\n for c in text:\n face.load_char(c, flags)\n kerning = face.get_kerning(previous, c)\n previous = c\n bitmap = face.glyph.bitmap\n pitch = face.glyph.bitmap.pitch\n width = face.glyph.bitmap.width\n rows = face.glyph.bitmap.rows\n top = face.glyph.bitmap_top\n left = face.glyph.bitmap_left\n pen.x += kerning.x\n x = (pen.x >> 6) - xmin + left\n y = (pen.y >> 6) - ymin - (rows - top)\n data = []\n for j in range(rows):\n data.extend(bitmap.buffer[j*pitch:j*pitch+width])\n if len(data):\n Z = np.array(data,dtype=np.ubyte).reshape(rows, width)\n L[y:y+rows,x:x+width] |= Z[::-1,::1]\n pen.x += face.glyph.advance.x\n pen.y += face.glyph.advance.y\n\n return L", "metadata": "root.make_label", "header": "['module', '___EOS___']", "index": 14 } ]
[ { "span": "bitmap ", "start_line": 44, "start_column": 8, "end_line": 44, "end_column": 14 }, { "span": "pitch ", "start_line": 45, "start_column": 8, "end_line": 45, "end_column": 13 } ]
[ { "span": "bitmap ", "start_line": 67, "start_column": 8, "end_line": 67, "end_column": 14 }, { "span": "pitch ", "start_line": 68, "start_column": 8, "end_line": 68, "end_column": 13 } ]
1
true
[ "[CLS]_", "Variable_", "defined_", "multiple_", "times_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "make", "\\u", "label_", "(_", "text_", ",_", "filename_", ",_", "size_", "=_", "12_", ",_", "angle_", "=_", "0_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Parameter", "s", ":", "\\", "10", ";", " ", " ", " ", " ", "-----------", "\\", "10", ";", " ", " ", " ", " ", "text", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "Text", " ", "to", " ", "be", " ", "displaye", "d", "\\", "10", ";", " ", " ", " ", " ", "filename", " ", ":", " ", "string", "\\", "10", ";", " ", " ", " ", " ", "Path", " ", "to", " ", "a", " ", "font", "\\", "10", ";", " ", " ", " ", " ", "size", " ", ":", " ", "int", "\\", "10", ";", " ", " ", " ", " ", "Font", " ", "size", " ", "in", " ", "1", "/", "64", "th", " ", "points", "\\", "10", ";", " ", " ", " ", " ", "angle", " ", ":", " ", "float", "\\", "10", ";", " ", " ", " ", " ", "Text", " ", "angle", " ", "in", " ", "degr", "ees", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "face_", "=_", "Face_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "face_", "._", "set\\u", "char", "\\u", "size_", "(_", "size_", "*_", "64_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "angle_", "=_", "(_", "angle_", "/_", "180.0_", ")_", "*_", "math_", "._", "pi_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "matrix_", "=_", "FT", "\\u", "Matrix_", "(_", "(_", "int_", ")_", "(_", "math_", "._", "cos_", "(_", "angle_", ")_", "*_", "0x10000", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "int_", ")_", "(_", "-_", "math_", "._", "sin_", "(_", "angle_", ")_", "*_", "0x10000", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "int_", ")_", "(_", "math_", "._", "sin_", "(_", "angle_", ")_", "*_", "0x10000", "_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "int_", ")_", "(_", "math_", "._", "cos_", "(_", "angle_", ")_", "*_", "0x10000", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "flags_", "=_", "FT", "\\u", "LOAD", "\\u", "RENDER", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pen_", "=_", "FT", "\\u", "Vector_", "(_", "0_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "FT", "\\u", "Set", "\\u", "Transform_", "(_", "face_", "._", "\\u", "FT", "\\u", "Face_", ",_", "byref_", "(_", "matrix_", ")_", ",_", "byref_", "(_", "pen_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "previous_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xmin_", ",_", "xmax_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ymin_", ",_", "ymax_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "text_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "face_", "._", "load", "\\u", "char_", "(_", "c_", ",_", "flags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kern", "ing_", "=_", "face_", "._", "get", "\\u", "kern", "ing_", "(_", "previous_", ",_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "previous_", "=_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bitmap_", "=_", "face_", "._", "glyph_", "._", "bitmap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pitch_", "=_", "face_", "._", "glyph_", "._", "bitmap_", "._", "pitch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "width_", "=_", "face_", "._", "glyph_", "._", "bitmap_", "._", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "face_", "._", "glyph_", "._", "bitmap_", "._", "rows_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "=_", "face_", "._", "glyph_", "._", "bitmap", "\\u", "top_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left_", "=_", "face_", "._", "glyph_", "._", "bitmap", "\\u", "left_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pen_", "._", "x_", "+=_", "kern", "ing_", "._", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x0_", "=_", "(_", "pen_", "._", "x_", ">>_", "6_", ")_", "+_", "left_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x1_", "=_", "x0_", "+_", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y0_", "=_", "(_", "pen_", "._", "y_", ">>_", "6_", ")_", "-_", "(_", "rows_", "-_", "top_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y1_", "=_", "y0_", "+_", "rows_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xmin_", ",_", "xmax_", "=_", "min_", "(_", "xmin_", ",_", "x0_", ")_", ",_", "max_", "(_", "xmax_", ",_", "x1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ymin_", ",_", "ymax_", "=_", "min_", "(_", "ymin_", ",_", "y0_", ")_", ",_", "max_", "(_", "ymax_", ",_", "y1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pen_", "._", "x_", "+=_", "face_", "._", "glyph_", "._", "advance_", "._", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pen_", "._", "y_", "+=_", "face_", "._", "glyph_", "._", "advance_", "._", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "L_", "=_", "np_", "._", "zeros_", "(_", "(_", "ymax_", "-_", "ymin_", ",_", "xmax_", "-_", "xmin_", ")_", ",_", "dtype_", "=_", "np_", "._", "ubyte_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "previous_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pen_", "._", "x_", ",_", "pen_", "._", "y_", "=_", "0_", ",_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "c_", "in_", "text_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "face_", "._", "load", "\\u", "char_", "(_", "c_", ",_", "flags_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "kern", "ing_", "=_", "face_", "._", "get", "\\u", "kern", "ing_", "(_", "previous_", ",_", "c_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "previous_", "=_", "c_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bitmap_", "=_", "face_", "._", "glyph_", "._", "bitmap_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pitch_", "=_", "face_", "._", "glyph_", "._", "bitmap_", "._", "pitch_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "width_", "=_", "face_", "._", "glyph_", "._", "bitmap_", "._", "width_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rows_", "=_", "face_", "._", "glyph_", "._", "bitmap_", "._", "rows_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "top_", "=_", "face_", "._", "glyph_", "._", "bitmap", "\\u", "top_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left_", "=_", "face_", "._", "glyph_", "._", "bitmap", "\\u", "left_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pen_", "._", "x_", "+=_", "kern", "ing_", "._", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "x_", "=_", "(_", "pen_", "._", "x_", ">>_", "6_", ")_", "-_", "xmin_", "+_", "left_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "y_", "=_", "(_", "pen_", "._", "y_", ">>_", "6_", ")_", "-_", "ymin_", "-_", "(_", "rows_", "-_", "top_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "data_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "j_", "in_", "range_", "(_", "rows_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "data_", "._", "extend_", "(_", "bitmap_", "._", "buffer_", "[_", "j_", "*_", "pitch_", ":_", "j_", "*_", "pitch_", "+_", "width_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "data_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "Z_", "=_", "np_", "._", "array_", "(_", "data_", ",_", "dtype_", "=_", "np_", "._", "ubyte_", ")_", "._", "reshape_", "(_", "rows_", ",_", "width_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "L_", "[_", "y_", ":_", "y_", "+_", "rows_", ",_", "x_", ":_", "x_", "+_", "width_", "]_", "|=_", "Z_", "[_", ":_", ":_", "-_", "1_", ",_", ":_", ":_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "pen_", "._", "x_", "+=_", "face_", "._", "glyph_", "._", "advance_", "._", "x_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pen_", "._", "y_", "+=_", "face_", "._", "glyph_", "._", "advance_", "._", "y_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "L_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
xraypy/xraylarch/tests/test_larchexamples_xray.py
[ { "content": "#!/usr/bin/env python\n\"\"\" Tests of Larch Scripts \"\"\"\nimport unittest\nimport time\nimport ast\nimport numpy as np\nfrom sys import version_info\n\nfrom utils import TestCase\nfrom larch import Interpreter\n\n\nif __name__ == '__main__': # pragma: no cover\n for suite in (TestScripts,):\n suite = unittest.TestLoader().loadTestsFromTestCase(suite)\n unittest.TextTestRunner(verbosity=3).run(suite)\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class TestScripts(TestCase):\n '''testing of examples/xray'''\n", "metadata": "root.TestScripts", "header": "['module', '___EOS___']", "index": 10 }, { "content": " def test1_mu_elam(self):\n self.runscript('get_mu_tables.lar', dirname='../examples/xray')\n assert(len(self.session.get_errors()) == 0)\n self.isTrue(\"len(mu1) == 401\")\n self.isTrue(\"min(mu1) < 20\")", "metadata": "root.TestScripts.test1_mu_elam", "header": "['class', 'TestScripts', '(', 'TestCase', ')', ':', '___EOS___']", "index": 12 }, { "content": " def test2_mu_elam(self):\n self.session.run(\"zn_iz = atomic_number('zn')\")\n self.session.run(\"zn_mass = atomic_mass('zn')\")\n assert(len(self.session.get_errors()) == 0)\n self.isTrue(\"zn_iz == 30\")\n self.isTrue(\"zn_mass > 60.\")", "metadata": "root.TestScripts.test2_mu_elam", "header": "['class', 'TestScripts', '(', 'TestCase', ')', ':', '___EOS___']", "index": 18 } ]
[ { "span": "import time", "start_line": 3, "start_column": 0, "end_line": 3, "end_column": 11 }, { "span": "import ast", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 10 }, { "span": "import numpy as np", "start_line": 5, "start_column": 0, "end_line": 5, "end_column": 18 }, { "span": "from sys import version_info", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 28 }, { "span": "from larch import Interpreter", "start_line": 9, "start_column": 0, "end_line": 9, "end_column": 29 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#!", "/", "usr", "/", "bin", "/", "env", " ", "python_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", " ", "Test", "s", " ", "of", " ", "Lar", "ch", " ", "Script", "s", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "unittest_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "time_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "ast_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "as_", "np_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "sys_", "import_", "version", "\\u", "info_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "utils_", "import_", "Test", "Case_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lar", "ch_", "import_", "Interpreter_", "\\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\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\\u\\u", "name\\u\\u_", "==_", "'\\u", "\\u", "main", "\\u\\u'_", ":_", "#", " ", "pragma", ":", " ", "no", " ", "cover_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "suite_", "in_", "(_", "Test", "Script", "s_", ",_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "suite_", "=_", "unittest_", "._", "Test", "Loader_", "(_", ")_", "._", "load", "Test", "s", "Fro", "m", "Test", "Case_", "(_", "suite_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unittest_", "._", "Text", "Test", "Runner_", "(_", "verbosity_", "=_", "3_", ")_", "._", "run_", "(_", "suite_", ")_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "class_", "Test", "Script", "s_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "testi", "ng", " ", "of", " ", "example", "s", "/", "xray", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Test", "Script", "s_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "test", "1", "\\u", "mu", "\\u", "ela", "m_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "runs", "cript_", "(_", "'", "get", "\\u", "mu", "\\u", "tables", ".", "lar", "'_", ",_", "dirname_", "=_", "'../", "example", "s", "/", "xray", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "len_", "(_", "self_", "._", "session_", "._", "get", "\\u", "errors_", "(_", ")_", ")_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "True_", "(_", "\"", "len", "(", "mu", "1", ")", " ", "==", " ", "401", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "True_", "(_", "\"", "min", "(", "mu", "1", ")", " ", "<", " ", "20", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Test", "Script", "s_", "(_", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test", "2", "\\u", "mu", "\\u", "ela", "m_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "session_", "._", "run_", "(_", "\"", "zn", "\\u", "iz", " ", "=", " ", "atomi", "c\\u", "number", "('", "zn", "')\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "session_", "._", "run_", "(_", "\"", "zn", "\\u", "mass", " ", "=", " ", "atomi", "c\\u", "mass", "('", "zn", "')\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "assert_", "(_", "len_", "(_", "self_", "._", "session_", "._", "get", "\\u", "errors_", "(_", ")_", ")_", "==_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "True_", "(_", "\"", "zn", "\\u", "iz", " ", "==", " ", "30", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "is", "True_", "(_", "\"", "zn", "\\u", "mass", " ", ">", " ", "60", ".\"_", ")_", "\\u\\u\\uN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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 ]
Unused import
sjuxax/raggregate/raggregate/rg_migrations/versions/001_Convert_datetimes_to_tz_awareness.py
[ { "content": "from sqlalchemy import *\nfrom migrate import *\nfrom migrate.changeset import *\n\nfrom raggregate.guid_recipe import GUID\n\n# referring to the models directly, this is \"very bad\" and sqlalchemy-migrate\n# docs will yell at you extensively for doing it. OH well, much easier this way\n# for the time being, and this migration is pretty basic so it shouldn't cause\n# problems down the road (hopefully).\n\nfrom raggregate.models import Submission\nfrom raggregate.models import User\nfrom raggregate.models import Comment\nfrom raggregate.models import Vote\nfrom raggregate.models import Epistle\nfrom raggregate.models import Stat\n\nmodel_list = ['Submission', 'User', 'Comment', 'Vote', 'Epistle', 'Stat']\n\nmeta = MetaData()\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def upgrade(migrate_engine):\n meta.bind = migrate_engine\n for m in model_list:\n t = eval(m).__table__\n t.metadata = meta\n for col in t.c:\n # modify all DateTime columns to tz awareness\n if type(col.type) == DateTime:\n col.alter(type = DateTime(timezone=True))", "metadata": "root.upgrade", "header": "['module', '___EOS___']", "index": 22 }, { "content": "def downgrade(migrate_engine):\n meta.bind = migrate_engine\n for m in model_list:\n t = eval(m).__table__\n t.metadata = meta\n for col in t.c:\n # modify all DateTime columns to tz naivety\n if type(col.type) == DateTime:\n col.alter(type = DateTime(timezone=False))", "metadata": "root.downgrade", "header": "['module', '___EOS___']", "index": 32 } ]
[ { "span": "from raggregate.guid_recipe import GUID", "start_line": 4, "start_column": 0, "end_line": 4, "end_column": 39 }, { "span": "from raggregate.models import Submission", "start_line": 11, "start_column": 0, "end_line": 11, "end_column": 40 }, { "span": "from raggregate.models import User", "start_line": 12, "start_column": 0, "end_line": 12, "end_column": 34 }, { "span": "from raggregate.models import Comment", "start_line": 13, "start_column": 0, "end_line": 13, "end_column": 37 }, { "span": "from raggregate.models import Vote", "start_line": 14, "start_column": 0, "end_line": 14, "end_column": 34 }, { "span": "from raggregate.models import Epistle", "start_line": 15, "start_column": 0, "end_line": 15, "end_column": 37 }, { "span": "from raggregate.models import Stat", "start_line": 16, "start_column": 0, "end_line": 16, "end_column": 34 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "sqlalchemy_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "migrate_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "migrate_", "._", "changeset_", "import_", "*_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "ragg", "rega", "te_", "._", "guid", "\\u", "recipe_", "import_", "GUID", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "refer", "ring", " ", "to", " ", "the", " ", "model", "s", " ", "direct", "ly", ",", " ", "this", " ", "is", " ", "\"", "very", " ", "bad", "\"", " ", "and", " ", "sqla", "lche", "my", "-", "migrate_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "docs", " ", "will", " ", "yell", " ", "at", " ", "you", " ", "extensi", "vel", "y", " ", "for", " ", "doi", "ng", " ", "it", ".", " ", "OH", " ", "well", ",", " ", "muc", "h", " ", "easi", "er", " ", "this", " ", "way_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "the", " ", "time", " ", "bei", "ng", ",", " ", "and", " ", "this", " ", "migrati", "on", " ", "is", " ", "pretty", " ", "basic", " ", "so", " ", "it", " ", "shou", "ld", "n", "'", "t", " ", "cause_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "problem", "s", " ", "down", " ", "the", " ", "road", " ", "(", "hop", "efu", "ll", "y", ").", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "ragg", "rega", "te_", "._", "models_", "import_", "Submission_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ragg", "rega", "te_", "._", "models_", "import_", "User_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ragg", "rega", "te_", "._", "models_", "import_", "Comment_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ragg", "rega", "te_", "._", "models_", "import_", "Vote", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ragg", "rega", "te_", "._", "models_", "import_", "Epi", "stl", "e_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "ragg", "rega", "te_", "._", "models_", "import_", "Stat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "model", "\\u", "list_", "=_", "[_", "'", "Subm", "ission", "'_", ",_", "'", "User", "'_", ",_", "'", "Comme", "nt", "'_", ",_", "'", "Vote", "'_", ",_", "'", "Epi", "stl", "e", "'_", ",_", "'", "Stat", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "meta_", "=_", "Meta", "Data_", "(_", ")_", "\\u\\u\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "upgrade_", "(_", "migr", "ate", "\\u", "engine_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "meta_", "._", "bind_", "=_", "migr", "ate", "\\u", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "m_", "in_", "model", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "eval_", "(_", "m_", ")_", "._", "\\u\\u", "table\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "metadata_", "=_", "meta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "col_", "in_", "t_", "._", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "modif", "y", " ", "all", " ", "Date", "Time", " ", "column", "s", " ", "to", " ", "tz", " ", "awa", "ren", "ess_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "col_", "._", "type_", ")_", "==_", "Date", "Time_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col_", "._", "alter", "_", "(_", "type_", "=_", "Date", "Time_", "(_", "timezone_", "=_", "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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "downgrade_", "(_", "migr", "ate", "\\u", "engine_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "meta_", "._", "bind_", "=_", "migr", "ate", "\\u", "engine_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "m_", "in_", "model", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "t_", "=_", "eval_", "(_", "m_", ")_", "._", "\\u\\u", "table\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "t_", "._", "metadata_", "=_", "meta_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "col_", "in_", "t_", "._", "c_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "modif", "y", " ", "all", " ", "Date", "Time", " ", "column", "s", " ", "to", " ", "tz", " ", "naive", "ty_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "type_", "(_", "col_", "._", "type_", ")_", "==_", "Date", "Time_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "col_", "._", "alter", "_", "(_", "type_", "=_", "Date", "Time_", "(_", "timezone_", "=_", "False_", ")_", ")_" ]
[ 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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from os import close, unlink\nfrom random import random\nfrom tempfile import mkstemp\n\nimport pytest\n\nfrom bepasty.app import create_app, create_storage\n\n\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "@pytest.yield_fixture(scope='module')\ndef app(request):\n \"\"\"\n creates a bepasty App-Instance\n \"\"\"\n app = create_app()\n yield app\n unlink(app.config['DATABASE'])", "metadata": "root.app", "header": "['module', '___EOS___']", "index": 9 }, { "content": "@pytest.yield_fixture(scope='module')\ndef testclient(request, app):\n \"\"\"\n creates a Flask-testclient instance for bepasty\n \"\"\"\n db_file, app.config['DATABASE'] = mkstemp()\n # reset default permissions\n app.config['DEFAULT_PERMISSIONS'] = ''\n # setup a secret key\n app.config['SECRET_KEY'] = str(random())\n # setup permissions\n app.config['PERMISSIONS'] = {\n 'l': 'list',\n 'c': 'create',\n 'r': 'read',\n 'd': 'delete',\n 'a': 'admin'\n }\n yield app.test_client()\n close(db_file)", "metadata": "root.testclient", "header": "['module', '___EOS___']", "index": 19 } ]
[ { "span": "from bepasty.app import create_app, create_storage", "start_line": 6, "start_column": 0, "end_line": 6, "end_column": 50 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "from_", "os_", "import_", "close_", ",_", "unlink_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "random_", "import_", "random_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "tempfile_", "import_", "mkstemp_", "\\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_", "from_", "be", "past", "y_", "._", "app_", "import_", "create", "\\u", "app_", ",_", "create", "\\u", "storage_", "\\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_", "@_", "pytest_", "._", "yield", "\\u", "fixture_", "(_", "scope_", "=_", "'", "module", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "app_", "(_", "request_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "create", "s", " ", "a", " ", "be", "past", "y", " ", "App", "-", "Insta", "nce", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "app_", "=_", "create", "\\u", "app_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "app_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "unlink_", "(_", "app_", "._", "config_", "[_", "'", "DATA", "BASE", "'_", "]_", ")_", "\\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_", "@_", "pytest_", "._", "yield", "\\u", "fixture_", "(_", "scope_", "=_", "'", "module", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "testc", "lient_", "(_", "request_", ",_", "app_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "create", "s", " ", "a", " ", "Fla", "sk", "-", "testc", "lien", "t", " ", "instance", " ", "for", " ", "be", "past", "y", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "db", "\\u", "file_", ",_", "app_", "._", "config_", "[_", "'", "DATA", "BASE", "'_", "]_", "=_", "mkstemp_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "reset", " ", "default", " ", "permissions_", "\\u\\u\\uNL\\u\\u\\u_", "app_", "._", "config_", "[_", "'", "DEF", "AUL", "T", "\\u", "PERMISSION", "S", "'_", "]_", "=_", "''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "setup", " ", "a", " ", "secret", " ", "key_", "\\u\\u\\uNL\\u\\u\\u_", "app_", "._", "config_", "[_", "'", "SEC", "RET", "\\u", "KEY", "'_", "]_", "=_", "str_", "(_", "random_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "setup", " ", "permissions_", "\\u\\u\\uNL\\u\\u\\u_", "app_", "._", "config_", "[_", "'", "PERMISSION", "S", "'_", "]_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "'", "l", "'_", ":_", "'", "list", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "c", "'_", ":_", "'", "create", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "r", "'_", ":_", "'", "read", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "d", "'_", ":_", "'", "delete", "'_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "'", "a", "'_", ":_", "'", "admin", "'_", "\\u\\u\\uNL\\u\\u\\u_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "yield_", "app_", "._", "test\\u", "client_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "close_", "(_", "db", "\\u", "file_", ")_" ]
[ 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
lambdalisue/django-permission/src/permission/compat.py
[ { "content": "# coding=utf-8\ntry:\n import collections\nexcept ImportError:\n\nimport django\nif django.VERSION >= (1, 9):\n add_to_builtins = None\nelse:\n try:\n from django.template.base import add_to_builtins\n except ImportError:\n from django.template.loader import add_to_builtins\n\ntry:\n # django.utils.importlib is removed from Django 1.9\n from importlib import import_module\nexcept ImportError:\n from django.utils.importlib import import_module\n\ntry:\n # Django 1.7 or over use the new application loading system\n from django.apps import apps\n get_model = apps.get_model\nexcept ImportError:\n from django.db.models.loading import get_model\n\ntry:\n from django.utils.module_loading import import_string\nexcept ImportError:\n try:\n from django.utils.module_loading import import_by_path as import_string\n except ImportError:\n\ntry:\n # Python 3\n from urllib.parse import urlparse\nexcept ImportError:\n # Python 2\n from urlparse import urlparse\n\nimport sys\nif sys.version_info >= (3, 0):\nelse:\n\ntry:\n from django.util import six\nexcept ImportError:\n # Django 1.2/1.3 does not have six\n import six\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": " def isiterable(x):\n return isinstance(x, collections.Iterable)", "metadata": "root.isiterable", "header": "['module', '___EOS___']", "index": 3 }, { "content": " def isiterable(x):\n try:\n iter(x)\n return True\n except TypeError:\n return False", "metadata": "root.isiterable", "header": "['module', '___EOS___']", "index": 6 }, { "content": " def import_string(dotted_path):\n try:\n module_path, class_name = dotted_path.rsplit('.', 1)\n except ValueError:\n raise ImportError(\n \"%s doesn't look like a module path\" % dotted_path\n )\n module = import_module(module_path)\n try:\n return getattr(module, class_name)\n except AttributeError:\n raise ImportError(\n 'Module \"%s\" does not define a \"%s\" attribute/class' % (\n module_path, class_name\n ))", "metadata": "root.import_string", "header": "['module', '___EOS___']", "index": 41 }, { "content": " def isstr(x):\n return isinstance(x, str)", "metadata": "root.isstr", "header": "['module', '___EOS___']", "index": 66 }, { "content": " def isstr(x):\n return isinstance(x, basestring)", "metadata": "root.isstr", "header": "['module', '___EOS___']", "index": 69 } ]
[ { "span": "from django.template.base import add_to_builtins", "start_line": 18, "start_column": 8, "end_line": 18, "end_column": 56 }, { "span": "from django.template.loader import add_to_builtins", "start_line": 20, "start_column": 8, "end_line": 20, "end_column": 58 }, { "span": "from django.db.models.loading import get_model", "start_line": 33, "start_column": 4, "end_line": 33, "end_column": 50 }, { "span": "from django.utils.module_loading import import_string", "start_line": 36, "start_column": 4, "end_line": 36, "end_column": 57 }, { "span": "from django.utils.module_loading import import_by_path as import_string", "start_line": 39, "start_column": 8, "end_line": 39, "end_column": 79 }, { "span": "from urllib.parse import urlparse", "start_line": 59, "start_column": 4, "end_line": 59, "end_column": 37 }, { "span": "from urlparse import urlparse", "start_line": 62, "start_column": 4, "end_line": 62, "end_column": 33 }, { "span": "from django.util import six", "start_line": 73, "start_column": 4, "end_line": 73, "end_column": 31 }, { "span": "import six", "start_line": 76, "start_column": 4, "end_line": 76, "end_column": 14 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "#", " ", "codi", "ng", "=", "utf", "-", "8_", "\\u\\u\\uNL\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "collections_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\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\\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_", "import_", "django_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "django_", "._", "VERSION_", ">=_", "(_", "1_", ",_", "9_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "add", "\\u", "to", "\\u", "builtins_", "=_", "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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "template_", "._", "base_", "import_", "add", "\\u", "to", "\\u", "builtins_", "\\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_", "django_", "._", "template_", "._", "loader_", "import_", "add", "\\u", "to", "\\u", "builtins_", "\\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_", "#", " ", "django", ".", "util", "s", ".", "import", "lib", " ", "is", " ", "remove", "d", " ", "from", " ", "Dj", "ang", "o", " ", "1.9", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "importlib_", "import_", "import", "\\u", "module_", "\\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_", "django_", "._", "utils_", "._", "importlib_", "import_", "import", "\\u", "module_", "\\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_", "#", " ", "Dj", "ang", "o", " ", "1.7", " ", "or", " ", "over", " ", "use", " ", "the", " ", "new", " ", "applica", "tion", " ", "load", "ing", " ", "system_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "apps_", "import_", "apps_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "model_", "=_", "apps_", "._", "get", "\\u", "model_", "\\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_", "django_", "._", "db_", "._", "models_", "._", "loading_", "import_", "get", "\\u", "model_", "\\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_", "django_", "._", "utils_", "._", "module", "\\u", "loading_", "import_", "import", "\\u", "string_", "\\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 ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "django_", "._", "utils_", "._", "module", "\\u", "loading_", "import_", "import", "\\u", "by", "\\u", "path_", "as_", "import", "\\u", "string_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "3_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "urllib_", "._", "parse_", "import_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Pyth", "on", " ", "2_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "urlparse_", "import_", "urlparse_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "sys_", "._", "version", "\\u", "info_", ">=_", "(_", "3_", ",_", "0_", ")_", ":_", "\\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\\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_", "django_", "._", "util_", "import_", "six_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Dj", "ang", "o", " ", "1.2", "/", "1.3", " ", "doe", "s", " ", "not", " ", "have", " ", "six_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "six_", "\\u\\u\\uDEDENT\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "isi", "tera", "ble_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "x_", ",_", "collections_", "._", "Iterable_", ")_", "\\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_", "isi", "tera", "ble_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "iter_", "(_", "x_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Type", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "False_", "\\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_", "import", "\\u", "string_", "(_", "dot", "ted", "\\u", "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 ", " _", "module", "\\u", "path_", ",_", "class", "\\u", "name_", "=_", "dot", "ted", "\\u", "path_", "._", "rsplit_", "(_", "'.'_", ",_", "1_", ")_", "\\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 ", " _", "raise_", "Import", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "\"%", "s", " ", "doe", "sn", "'", "t", " ", "look", " ", "like", " ", "a", " ", "module", " ", "path", "\"_", "%_", "dot", "ted", "\\u", "path_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "module_", "=_", "import", "\\u", "module_", "(_", "module", "\\u", "path_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "getattr_", "(_", "module_", ",_", "class", "\\u", "name_", ")_", "\\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 ", " _", "raise_", "Import", "Error_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "'", "Modul", "e", " ", "\"%", "s", "\"", " ", "doe", "s", " ", "not", " ", "defin", "e", " ", "a", " ", "\"%", "s", "\"", " ", "attribute", "/", "class", "'_", "%_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "module", "\\u", "path_", ",_", "class", "\\u", "name_", "\\u\\u\\uNL\\u\\u\\u_", ")_", ")_", "\\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_", "iss", "tr_", "(_", "x_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "isinstance_", "(_", "x_", ",_", "str_", ")_",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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, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
lsaffre/lino/lino/api/dd.py
[ { "content": "# -*- coding: UTF-8 -*-\n# Copyright 2011-2016 Luc Saffre\n# License: BSD (see file COPYING for details)\n\n\"\"\"\nThe :mod:`lino.api.dd` module is a shortcut to those parts of Lino which\nare used in your :xfile:`models.py` modules. The name ``dd`` stands\nfor \"Database Design\".\n\nApplication:\n\n- :attr:`plugins <lino.core.site.Site.plugins>`\n- :attr:`decfmt <lino.core.site.Site.decfmt>`\n- :attr:`str2kw <lino.core.site.Site.str2kw>`\n- :attr:`today <lino.core.site.Site.today>`\n- :attr:`strftime <lino.core.site.Site.strftime>`\n- :attr:`demo_date <lino.core.site.Site.demo_date>`\n- :attr:`is_abstract_model <lino.core.site.Site.is_abstract_model>`\n- :attr:`is_installed <lino.core.site.Site.is_installed>`\n- :attr:`add_welcome_handler <lino.core.site.Site.add_welcome_handler>`\n- :attr:`build_media_url <lino.core.site.Site.build_media_url>`\n- :attr:`get_default_language <lino.core.site.Site.get_default_language>`\n\n\nTables:\n\n- :class:`Table <lino.core.dbtables.Table>`\n- :class:`VirtualTable`\n- :class:`VentilatingTable`\n- :class:`Frame <lino.core.frames.Frame>`\n- :class:`ChoiceList <lino.core.choicelists.ChoiceList>`\n\nExtended Fields:\n\n- :class:`CharField <fields.CharField>`\n- :class:`NullCharField <lino.core.fields.NullCharField>`\n- :class:`IncompleteDateField <lino.core.fields.IncompleteDateField>`\n- :class:`PasswordField <lino.core.fields.PasswordField>`\n- :class:`MonthField <lino.core.fields.MonthField>`\n- :class:`PercentageField <lino.core.fields.PercentageField>`\n- :class:`QuantityField <lino.core.fields.QuantityField>`\n- :class:`PriceField<lino.core.fields.PriceField>`\n- :class:`CustomField <lino.core.fields.CustomField>`\n- :class:`RecurrenceField <lino.core.fields.RecurrenceField>`\n- :class:`DummyField <lino.core.fields.DummyField>`\n- :func:`ForeignKey <lino.core.fields.ForeignKey>`\n\nVirtual Fields:\n\n- :class:`Constant <lino.core.fields.Constant>` and\n :class:`@constant <lino.core.fields.constant>`\n- :class:`DisplayField <lino.core.fields.DisplayField>` and\n :class:`@displayfield <lino.core.fields.displayfield>`\n- :class:`VirtualField <lino.core.fields.VirtualField>` and\n :class:`@virtualfield <lino.core.fields.virtualfield>`\n- :class:`HtmlBox <lino.core.fields.HtmlBox>`\n\nLayouts:\n\n- :class:`FormLayout <lino.core.layouts.FormLayout>`\n- :class:`Panel <lino.core.layouts.Panel>`\n\nUtilities:\n\n- :func:`obj2str <lino.core.utils.obj2str>`\n- :func:`obj2unicode <lino.core.utils.obj2unicode>`\n- :func:`range_filter <lino.core.utils.range_filter>`,\n :func:`inrange_filter <lino.core.utils.inrange_filter>`\n- :func:`full_model_name <lino.core.utils.full_model_name>`\n- :func:`fields_list <lino.core.fields.fields_list>`\n- :func:`chooser <lino.utils.choosers.chooser>`\n- :class: `ParameterPanel <lino.core.utils.ParameterPanel>`\n\n\nInter-app relations:\n\n- :func:`resolve_field <lino.core.utils.resolve_field>`\n- :func:`resolve_model <lino.core.utils.resolve_model>`\n- :func:`resolve_app <lino.core.utils.resolve_app>`\n- :func:`update_field <lino.core.inject.update_field>`\n- :func:`inject_field <lino.core.inject.inject_field>`\n- :func:`inject_action <lino.core.inject.inject_action>`\n- :func:`update_model <lino.core.inject.update_model>`\n\n- :func:`inject_quick_add_buttons <lino.core.inject.inject_quick_add_buttons>`\n\nSignals:\n\n- See :ref:`lino.signals`\n\nActions:\n\n- :class:`Action <lino.core.actions.Action>`\n- :class:`ChangeStateAction <lino.core.workflows.ChangeStateAction>`\n- :class:`NotifyingAction <lino.core.actions.NotifyingAction>`\n- :class:`MergeAction <lino.core.merge.MergeAction>`\n- :class:`ShowSlaveTable <lino.core.actions.ShowSlaveTable>`\n- :class:`PrintTableAction <lino.utils.appy_pod.PrintTableAction>`\n\nPermissions:\n\n- :class:`UserGroups <lino.modlib.users.mixins.UserGroups>`\n- :class:`UserLevels <lino.modlib.users.mixins.UserLevels>`\n- :func:`add_user_group <lino.modlib.users.mixins.add_user_group>`\n\n\nWorkflows:\n\n- :class:`Workflow <lino.core.workflows.Workflow>`\n- :class:`State <lino.core.workflows.State>`\n\n\n\"\"\"\n\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\n\n\nimport logging\nlogger = logging.getLogger(__name__)\n\"\"\"\nShortcut to the main Lino logger.\n\"\"\"\n\n# logger.info(\"20140227 dd.py a\")\n\nfrom django.conf import settings\nfrom django.utils.encoding import python_2_unicode_compatible\n\nfrom lino.core.tables import VirtualTable\n\nfrom lino.core.utils import resolve_model, UnresolvedModel\n\nfrom lino.core.utils import resolve_app, require_app_models\nfrom lino.core.utils import resolve_field, get_field\nfrom lino.core.utils import obj2str\nfrom lino.core.utils import obj2unicode\nfrom lino.core.utils import range_filter\nfrom lino.core.utils import inrange_filter\nfrom lino.core.utils import full_model_name\n\nfrom lino.core.model import Model\n\"Shortcut to :class:`lino.core.model.Model`.\"\n\nfrom lino.core.merge import MergeAction\n\nfrom lino.core.actors import Actor\n\nfrom lino.core.dbtables import has_fk\nfrom lino.core.dbtables import Table\nfrom django.db.models.fields import FieldDoesNotExist\nfrom django.db import models\n\nfrom lino.core.frames import Frame\nfrom lino.core.tables import VentilatingTable\n\nfrom lino.core.actions import action\nfrom lino.core.actions import Action\nfrom lino.core.actions import MultipleRowAction\nfrom lino.core.actions import ShowSlaveTable\n\nfrom lino.core.actions import GridEdit, ShowDetailAction\nfrom lino.core.actions import InsertRow, DeleteSelected\nfrom lino.core.actions import SubmitDetail, SubmitInsert\n\nfrom lino.core.choicelists import ChoiceList, Choice\nfrom lino.core.workflows import State, Workflow, ChangeStateAction\nfrom lino.core.actions import NotifyingAction\n\n\nfrom lino.core.fields import fields_list, ImportedFields\nfrom lino.core.fields import Dummy, DummyField\n\n# 20140314 need a Dummy object to define a dummy module\n# from lino.core.layouts import BaseLayout as Dummy # 20140314\n# from lino.core.actors import Actor as Dummy # 20140314\n\nfrom lino.core.fields import CustomField\nfrom lino.core.fields import RecurrenceField\nfrom lino.core.fields import IncompleteDateField\nfrom lino.core.fields import DatePickerField\nfrom lino.core.fields import NullCharField\nfrom lino.core.fields import PasswordField\nfrom lino.core.fields import MonthField\nfrom lino.core.fields import PercentageField\n#~ from lino.core.fields import LinkedForeignKey\nfrom lino.core.fields import QuantityField\nfrom lino.core.fields import DurationField\nfrom lino.core.fields import HtmlBox, PriceField, RichTextField\n\nfrom lino.core.fields import DisplayField, displayfield, htmlbox\nfrom lino.core.fields import VirtualField, virtualfield\nfrom lino.core.fields import RequestField, requestfield\nfrom lino.core.fields import Constant, constant\nfrom lino.core.fields import ForeignKey\nfrom lino.core.fields import CharField\n\n# from lino_xl.lib.appypod.mixins import PrintTableAction\n\nfrom lino.core.utils import babelkw\n# from lino.core.utils import babelattr\nfrom lino.core.utils import babel_values # alias for babelkw for backward compat\n\nfrom lino.utils.choosers import chooser, action_chooser\n\nfrom lino.core.layouts import FormLayout, DetailLayout, InsertLayout, Panel\nfrom lino.core.layouts import ParamsLayout\nfrom lino.core.layouts import DummyPanel\n\n\nfrom lino.core.signals import on_ui_created, pre_ui_delete, on_ui_updated\n\nfrom lino.core.signals import database_connected\nfrom lino.core.signals import database_ready\nfrom lino.core.signals import pre_startup, post_startup\nfrom lino.core.signals import pre_analyze\nfrom lino.core.signals import post_analyze\nfrom lino.core.signals import auto_create\nfrom lino.core.signals import pre_merge\nfrom lino.core.signals import pre_add_child\nfrom lino.core.signals import pre_remove_child\nfrom lino.core.signals import pre_ui_build\nfrom lino.core.signals import post_ui_build\n\nfrom django.db.models.signals import pre_save, post_save\nfrom django.db.models.signals import pre_init, post_init\nfrom django.db.models.signals import class_prepared\n\nfrom django.db.backends.signals import connection_created\n\nfrom django.dispatch import receiver\n#~ from lino.core import signals\n\n\nfrom django.db.models.fields import NOT_PROVIDED\n\n#~ class Module(object):\n #~ pass\n\nfrom lino.core.inject import inject_action\nfrom lino.core.inject import inject_field\nfrom lino.core.inject import update_model\nfrom lino.core.inject import update_field\nfrom lino.core.inject import inject_quick_add_buttons\nfrom lino.core.inject import do_when_prepared, when_prepared\n\nfrom lino.core.utils import ParameterPanel, PseudoRequest\n\n#from lino.modlib.users.choicelists import UserLevels, UserGroups\n#from lino.modlib.users.utils import add_user_group\n\n\nfrom lino.utils import IncompleteDate\n\nfrom lino.utils.format_date import fdm, fdl, fdf, fdmy\nfrom lino.utils.format_date import fds as fds_\n\n\n\n# backward compatibility\ndtos = fds\nfrom lino.utils.format_date import fdl as dtosl\n\nbabelitem = settings.SITE.babelitem\nfield2kw = settings.SITE.field2kw\n\nfrom lino.utils.mldbc.fields import BabelTextField\nfrom lino.utils.mldbc.fields import BabelCharField, LanguageField\n\nfrom lino.modlib.system.choicelists import Genders, PeriodEvents, YesNo\n\nfrom importlib import import_module\n\n# The following are not only shortcuts, they also are a preparation to\n# encapsulate the `settings.SITE` name. It is possible that after\n# Django 1.7 we no longer need a `settings.SITE`. So I plan to\n# deprecate direct access to settings.SITE in application code. I am\n# not yet 100% sure whether this will be possible and makes sense.\n\ndecfmt = settings.SITE.decfmt\nstr2kw = settings.SITE.str2kw\n\n\n# today = settings.SITE.today\nstrftime = settings.SITE.strftime\ndemo_date = settings.SITE.demo_date\nis_abstract_model = settings.SITE.is_abstract_model\nis_installed = settings.SITE.is_installed\n# get_db_overview_rst = settings.SITE.get_db_overview_rst\nadd_welcome_handler = settings.SITE.add_welcome_handler\nbuild_media_url = settings.SITE.build_media_url\nbuild_static_url = settings.SITE.build_static_url\nget_default_language = settings.SITE.get_default_language\nresolve_languages = settings.SITE.resolve_languages\nbabelattr = settings.SITE.babelattr\n\napps = plugins = settings.SITE.plugins\n# `apps` is an alias for `plugins`. We recommend plugins since `apps`\n# is being used by Django 1.7\n\n\n\nfrom django.utils import translation\nget_language = translation.get_language\n\nfrom lino.core.roles import SiteStaff, SiteUser, SiteAdmin, login_required\n\n\n# deprecated aliases:\nRequired = required = login_required\n\n# logger.info(\"20140227 dd.py b %s\", site)\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "def fds(d):\n \"\"\"\n Adds support for :class:`lino.fields.IncompleteDate`.\n \"\"\"\n if isinstance(d, IncompleteDate):\n return fds_(d.as_date())\n return fds_(d)", "metadata": "root.fds", "header": "['module', '___EOS___']", "index": 258 }, { "content": "def today(*args, **kwargs):\n # make it serializable for Django migrations\n return settings.SITE.today(*args, **kwargs)", "metadata": "root.today", "header": "['module', '___EOS___']", "index": 290 }, { "content": "def resolve_plugin(app_label):\n return plugins.get(app_label, None)", "metadata": "root.resolve_plugin", "header": "['module', '___EOS___']", "index": 311 } ]
[ { "span": "from django.utils.encoding import python_2_unicode_compatible", "start_line": 127, "start_column": 0, "end_line": 127, "end_column": 61 }, { "span": "from lino.core.tables import VirtualTable", "start_line": 129, "start_column": 0, "end_line": 129, "end_column": 41 }, { "span": "from lino.core.utils import resolve_model, UnresolvedModel", "start_line": 131, "start_column": 0, "end_line": 131, "end_column": 58 }, { "span": "from lino.core.utils import resolve_app, require_app_models", "start_line": 133, "start_column": 0, "end_line": 133, "end_column": 59 }, { "span": "from lino.core.utils import resolve_field, get_field", "start_line": 134, "start_column": 0, "end_line": 134, "end_column": 52 }, { "span": "from lino.core.utils import obj2str", "start_line": 135, "start_column": 0, "end_line": 135, "end_column": 35 }, { "span": "from lino.core.utils import obj2unicode", "start_line": 136, "start_column": 0, "end_line": 136, "end_column": 39 }, { "span": "from lino.core.utils import range_filter", "start_line": 137, "start_column": 0, "end_line": 137, "end_column": 40 }, { "span": "from lino.core.utils import inrange_filter", "start_line": 138, "start_column": 0, "end_line": 138, "end_column": 42 }, { "span": "from lino.core.utils import full_model_name", "start_line": 139, "start_column": 0, "end_line": 139, "end_column": 43 }, { "span": "from lino.core.model import Model", "start_line": 141, "start_column": 0, "end_line": 141, "end_column": 33 }, { "span": "from lino.core.merge import MergeAction", "start_line": 144, "start_column": 0, "end_line": 144, "end_column": 39 }, { "span": "from lino.core.actors import Actor", "start_line": 146, "start_column": 0, "end_line": 146, "end_column": 34 }, { "span": "from lino.core.dbtables import has_fk", "start_line": 148, "start_column": 0, "end_line": 148, "end_column": 37 }, { "span": "from lino.core.dbtables import Table", "start_line": 149, "start_column": 0, "end_line": 149, "end_column": 36 }, { "span": "from django.db.models.fields import FieldDoesNotExist", "start_line": 150, "start_column": 0, "end_line": 150, "end_column": 53 }, { "span": "from django.db import models", "start_line": 151, "start_column": 0, "end_line": 151, "end_column": 28 }, { "span": "from lino.core.frames import Frame", "start_line": 153, "start_column": 0, "end_line": 153, "end_column": 34 }, { "span": "from lino.core.tables import VentilatingTable", "start_line": 154, "start_column": 0, "end_line": 154, "end_column": 45 }, { "span": "from lino.core.actions import action", "start_line": 156, "start_column": 0, "end_line": 156, "end_column": 36 }, { "span": "from lino.core.actions import Action", "start_line": 157, "start_column": 0, "end_line": 157, "end_column": 36 }, { "span": "from lino.core.actions import MultipleRowAction", "start_line": 158, "start_column": 0, "end_line": 158, "end_column": 47 }, { "span": "from lino.core.actions import ShowSlaveTable", "start_line": 159, "start_column": 0, "end_line": 159, "end_column": 44 }, { "span": "from lino.core.actions import GridEdit, ShowDetailAction", "start_line": 161, "start_column": 0, "end_line": 161, "end_column": 56 }, { "span": "from lino.core.actions import InsertRow, DeleteSelected", "start_line": 162, "start_column": 0, "end_line": 162, "end_column": 55 }, { "span": "from lino.core.actions import SubmitDetail, SubmitInsert", "start_line": 163, "start_column": 0, "end_line": 163, "end_column": 56 }, { "span": "from lino.core.choicelists import ChoiceList, Choice", "start_line": 165, "start_column": 0, "end_line": 165, "end_column": 52 }, { "span": "from lino.core.workflows import State, Workflow, ChangeStateAction", "start_line": 166, "start_column": 0, "end_line": 166, "end_column": 66 }, { "span": "from lino.core.actions import NotifyingAction", "start_line": 167, "start_column": 0, "end_line": 167, "end_column": 45 }, { "span": "from lino.core.fields import fields_list, ImportedFields", "start_line": 170, "start_column": 0, "end_line": 170, "end_column": 56 }, { "span": "from lino.core.fields import Dummy, DummyField", "start_line": 171, "start_column": 0, "end_line": 171, "end_column": 46 }, { "span": "from lino.core.fields import CustomField", "start_line": 177, "start_column": 0, "end_line": 177, "end_column": 40 }, { "span": "from lino.core.fields import RecurrenceField", "start_line": 178, "start_column": 0, "end_line": 178, "end_column": 44 }, { "span": "from lino.core.fields import IncompleteDateField", "start_line": 179, "start_column": 0, "end_line": 179, "end_column": 48 }, { "span": "from lino.core.fields import DatePickerField", "start_line": 180, "start_column": 0, "end_line": 180, "end_column": 44 }, { "span": "from lino.core.fields import NullCharField", "start_line": 181, "start_column": 0, "end_line": 181, "end_column": 42 }, { "span": "from lino.core.fields import PasswordField", "start_line": 182, "start_column": 0, "end_line": 182, "end_column": 42 }, { "span": "from lino.core.fields import MonthField", "start_line": 183, "start_column": 0, "end_line": 183, "end_column": 39 }, { "span": "from lino.core.fields import PercentageField", "start_line": 184, "start_column": 0, "end_line": 184, "end_column": 44 }, { "span": "from lino.core.fields import QuantityField", "start_line": 186, "start_column": 0, "end_line": 186, "end_column": 42 }, { "span": "from lino.core.fields import DurationField", "start_line": 187, "start_column": 0, "end_line": 187, "end_column": 42 }, { "span": "from lino.core.fields import HtmlBox, PriceField, RichTextField", "start_line": 188, "start_column": 0, "end_line": 188, "end_column": 63 }, { "span": "from lino.core.fields import DisplayField, displayfield, htmlbox", "start_line": 190, "start_column": 0, "end_line": 190, "end_column": 64 }, { "span": "from lino.core.fields import VirtualField, virtualfield", "start_line": 191, "start_column": 0, "end_line": 191, "end_column": 55 }, { "span": "from lino.core.fields import RequestField, requestfield", "start_line": 192, "start_column": 0, "end_line": 192, "end_column": 55 }, { "span": "from lino.core.fields import Constant, constant", "start_line": 193, "start_column": 0, "end_line": 193, "end_column": 47 }, { "span": "from lino.core.fields import ForeignKey", "start_line": 194, "start_column": 0, "end_line": 194, "end_column": 39 }, { "span": "from lino.core.fields import CharField", "start_line": 195, "start_column": 0, "end_line": 195, "end_column": 38 }, { "span": "from lino.core.utils import babelkw", "start_line": 199, "start_column": 0, "end_line": 199, "end_column": 35 }, { "span": "from lino.core.utils import babel_values ", "start_line": 201, "start_column": 0, "end_line": 201, "end_column": 40 }, { "span": "from lino.utils.choosers import chooser, action_chooser", "start_line": 203, "start_column": 0, "end_line": 203, "end_column": 55 }, { "span": "from lino.core.layouts import FormLayout, DetailLayout, InsertLayout, Panel", "start_line": 205, "start_column": 0, "end_line": 205, "end_column": 75 }, { "span": "from lino.core.layouts import ParamsLayout", "start_line": 206, "start_column": 0, "end_line": 206, "end_column": 42 }, { "span": "from lino.core.layouts import DummyPanel", "start_line": 207, "start_column": 0, "end_line": 207, "end_column": 40 }, { "span": "from lino.core.signals import on_ui_created, pre_ui_delete, on_ui_updated", "start_line": 210, "start_column": 0, "end_line": 210, "end_column": 73 }, { "span": "from lino.core.signals import database_connected", "start_line": 212, "start_column": 0, "end_line": 212, "end_column": 48 }, { "span": "from lino.core.signals import database_ready", "start_line": 213, "start_column": 0, "end_line": 213, "end_column": 44 }, { "span": "from lino.core.signals import pre_startup, post_startup", "start_line": 214, "start_column": 0, "end_line": 214, "end_column": 55 }, { "span": "from lino.core.signals import pre_analyze", "start_line": 215, "start_column": 0, "end_line": 215, "end_column": 41 }, { "span": "from lino.core.signals import post_analyze", "start_line": 216, "start_column": 0, "end_line": 216, "end_column": 42 }, { "span": "from lino.core.signals import auto_create", "start_line": 217, "start_column": 0, "end_line": 217, "end_column": 41 }, { "span": "from lino.core.signals import pre_merge", "start_line": 218, "start_column": 0, "end_line": 218, "end_column": 39 }, { "span": "from lino.core.signals import pre_add_child", "start_line": 219, "start_column": 0, "end_line": 219, "end_column": 43 }, { "span": "from lino.core.signals import pre_remove_child", "start_line": 220, "start_column": 0, "end_line": 220, "end_column": 46 }, { "span": "from lino.core.signals import pre_ui_build", "start_line": 221, "start_column": 0, "end_line": 221, "end_column": 42 }, { "span": "from lino.core.signals import post_ui_build", "start_line": 222, "start_column": 0, "end_line": 222, "end_column": 43 }, { "span": "from django.db.models.signals import pre_save, post_save", "start_line": 224, "start_column": 0, "end_line": 224, "end_column": 56 }, { "span": "from django.db.models.signals import pre_init, post_init", "start_line": 225, "start_column": 0, "end_line": 225, "end_column": 56 }, { "span": "from django.db.models.signals import class_prepared", "start_line": 226, "start_column": 0, "end_line": 226, "end_column": 51 }, { "span": "from django.db.backends.signals import connection_created", "start_line": 228, "start_column": 0, "end_line": 228, "end_column": 57 }, { "span": "from django.dispatch import receiver", "start_line": 230, "start_column": 0, "end_line": 230, "end_column": 36 }, { "span": "from django.db.models.fields import NOT_PROVIDED", "start_line": 234, "start_column": 0, "end_line": 234, "end_column": 48 }, { "span": "from lino.core.inject import inject_action", "start_line": 239, "start_column": 0, "end_line": 239, "end_column": 42 }, { "span": "from lino.core.inject import inject_field", "start_line": 240, "start_column": 0, "end_line": 240, "end_column": 41 }, { "span": "from lino.core.inject import update_model", "start_line": 241, "start_column": 0, "end_line": 241, "end_column": 41 }, { "span": "from lino.core.inject import update_field", "start_line": 242, "start_column": 0, "end_line": 242, "end_column": 41 }, { "span": "from lino.core.inject import inject_quick_add_buttons", "start_line": 243, "start_column": 0, "end_line": 243, "end_column": 53 }, { "span": "from lino.core.inject import do_when_prepared, when_prepared", "start_line": 244, "start_column": 0, "end_line": 244, "end_column": 60 }, { "span": "from lino.core.utils import ParameterPanel, PseudoRequest", "start_line": 246, "start_column": 0, "end_line": 246, "end_column": 57 }, { "span": "from lino.utils.format_date import fdm, fdl, fdf, fdmy", "start_line": 254, "start_column": 0, "end_line": 254, "end_column": 54 }, { "span": "from lino.utils.format_date import fdl as dtosl", "start_line": 268, "start_column": 0, "end_line": 268, "end_column": 47 }, { "span": "from lino.utils.mldbc.fields import BabelTextField", "start_line": 273, "start_column": 0, "end_line": 273, "end_column": 50 }, { "span": "from lino.utils.mldbc.fields import BabelCharField, LanguageField", "start_line": 274, "start_column": 0, "end_line": 274, "end_column": 65 }, { "span": "from lino.modlib.system.choicelists import Genders, PeriodEvents, YesNo", "start_line": 276, "start_column": 0, "end_line": 276, "end_column": 71 }, { "span": "from importlib import import_module", "start_line": 278, "start_column": 0, "end_line": 278, "end_column": 35 }, { "span": "from lino.core.roles import SiteStaff, SiteUser, SiteAdmin, login_required", "start_line": 317, "start_column": 0, "end_line": 317, "end_column": 74 } ]
[]
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_", "#", " ", "Copy", "right", " ", "2011", "-", "2016", " ", "Luc", " ", "Saf", "fre", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "License", ":", " ", "BS", "D", " ", "(", "see", " ", "file", " ", "COPY", "ING", " ", "for", " ", "deta", "il", "s", ")_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "The", " ", ":", "mod", ":`", "lino", ".", "api", ".", "dd", "`", " ", "module", " ", "is", " ", "a", " ", "shortcut", " ", "to", " ", "tho", "se", " ", "part", "s", " ", "of", " ", "Lin", "o", " ", "whi", "ch", "\\", "10", ";", "are", " ", "used", " ", "in", " ", "your", " ", ":", "xfi", "le", ":`", "model", "s", ".", "py", "`", " ", "module", "s", ".", " ", " ", "The", " ", "name", " ", "``", "dd", "``", " ", "stand", "s", "\\", "10", ";", "for", " ", "\"", "Databa", "se", " ", "Desig", "n", "\".\\", "10", ";", "\\", "10", ";", "Applica", "tion", ":", "\\", "10", ";", "\\", "10", ";", "-", " ", ":", "attr", ":`", "plugin", "s", " ", "<", "lino", ".", "core", ".", "site", ".", "Site", ".", "plugin", "s", ">`", "\\", "10", ";", "-", " ", ":", "attr", ":`", "dec", "fmt", " ", "<", "lino", ".", "core", ".", "site", ".", "Site", ".", "dec", "fmt", ">`", "\\", "10", ";", "-", " ", ":", "attr", ":`", "str2", "kw", " ", "<", "lino", ".", "core", ".", "site", ".", "Site", ".", "str2", "kw", ">`", "\\", "10", ";", "-", " ", ":", "attr", ":`", "toda", "y", " ", "<", "lino", ".", "core", ".", "site", ".", "Site", ".", "toda", "y", ">`", "\\", "10", ";", "-", " ", ":", "attr", ":`", "strf", "time", " ", "<", "lino", ".", "core", ".", "site", ".", "Site", ".", "strf", "time", ">`", "\\", "10", ";", "-", " ", ":", "attr", ":`", "demo", "\\u", "date", " ", "<", "lino", ".", "core", ".", "site", ".", "Site", ".", "demo", "\\u", "date", ">`", "\\", "10", ";", "-", " ", ":", "attr", ":`", "is", "\\u", "abstract", "\\u", "model", " ", "<", "lino", ".", "core", ".", "site", ".", "Site", ".", "is", "\\u", "abstract", "\\u", "model", ">`", "\\", "10", ";", "-", " ", ":", "attr", ":`", "is", "\\u", "install", "ed", " ", "<", "lino", ".", "core", ".", "site", ".", "Site", ".", "is", "\\u", "install", "ed", ">`", "\\", "10", ";", "-", " ", ":", "attr", ":`", "add", "\\u", "welcome", "\\u", "handler", " ", "<", "lino", ".", "core", ".", "site", ".", "Site", ".", "add", "\\u", "welcome", "\\u", "handler", ">`", "\\", "10", ";", "-", " ", ":", "attr", ":`", "build", "\\u", "media", "\\u", "url", " ", "<", "lino", ".", "core", ".", "site", ".", "Site", ".", "build", "\\u", "media", "\\u", "url", ">`", "\\", "10", ";", "-", " ", ":", "attr", ":`", "get", "\\u", "default", "\\u", "language", " ", "<", "lino", ".", "core", ".", "site", ".", "Site", ".", "get", "\\u", "default", "\\u", "language", ">`", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", "Table", "s", ":", "\\", "10", ";", "\\", "10", ";", "-", " ", ":", "class", ":`", "Table", " ", "<", "lino", ".", "core", ".", "dbt", "able", "s", ".", "Table", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Virt", "ual", "Table", "`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Vent", "ilat", "ing", "Table", "`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Frame", " ", "<", "lino", ".", "core", ".", "frames", ".", "Frame", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Choi", "ce", "List", " ", "<", "lino", ".", "core", ".", "choice", "lists", ".", "Choi", "ce", "List", ">`", "\\", "10", ";", "\\", "10", ";", "Extend", "ed", " ", "Field", "s", ":", "\\", "10", ";", "\\", "10", ";", "-", " ", ":", "class", ":`", "Char", "Field", " ", "<", "fields", ".", "Char", "Field", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Null", "Char", "Field", " ", "<", "lino", ".", "core", ".", "fields", ".", "Null", "Char", "Field", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Incomp", "lete", "Date", "Field", " ", "<", "lino", ".", "core", ".", "fields", ".", "Incomp", "lete", "Date", "Field", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Passw", "ord", "Field", " ", "<", "lino", ".", "core", ".", "fields", ".", "Passw", "ord", "Field", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Mont", "h", "Field", " ", "<", "lino", ".", "core", ".", "fields", ".", "Mont", "h", "Field", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Perce", "nta", "ge", "Field", " ", "<", "lino", ".", "core", ".", "fields", ".", "Perce", "nta", "ge", "Field", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Quanti", "ty", "Field", " ", "<", "lino", ".", "core", ".", "fields", ".", "Quanti", "ty", "Field", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Price", "Field", "<", "lino", ".", "core", ".", "fields", ".", "Price", "Field", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Custom", "Field", " ", "<", "lino", ".", "core", ".", "fields", ".", "Custom", "Field", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Recurren", "ce", "Field", " ", "<", "lino", ".", "core", ".", "fields", ".", "Recurren", "ce", "Field", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Du", "mm", "y", "Field", " ", "<", "lino", ".", "core", ".", "fields", ".", "Du", "mm", "y", "Field", ">`", "\\", "10", ";", "-", " ", ":", "func", ":`", "Fore", "ign", "Key", " ", "<", "lino", ".", "core", ".", "fields", ".", "Fore", "ign", "Key", ">`", "\\", "10", ";", "\\", "10", ";", "Virt", "ual", " ", "Field", "s", ":", "\\", "10", ";", "\\", "10", ";", "-", " ", ":", "class", ":`", "Const", "ant", " ", "<", "lino", ".", "core", ".", "fields", ".", "Const", "ant", ">`", " ", "and", "\\", "10", ";", " ", " ", ":", "class", ":`", "@", "constant", " ", "<", "lino", ".", "core", ".", "fields", ".", "constant", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Display", "Field", " ", "<", "lino", ".", "core", ".", "fields", ".", "Display", "Field", ">`", " ", "and", "\\", "10", ";", " ", " ", ":", "class", ":`", "@", "display", "field", " ", "<", "lino", ".", "core", ".", "fields", ".", "display", "field", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Virt", "ual", "Field", " ", "<", "lino", ".", "core", ".", "fields", ".", "Virt", "ual", "Field", ">`", " ", "and", "\\", "10", ";", " ", " ", ":", "class", ":`", "@", "virtual", "field", " ", "<", "lino", ".", "core", ".", "fields", ".", "virtual", "field", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Ht", "ml", "Box", " ", "<", "lino", ".", "core", ".", "fields", ".", "Ht", "ml", "Box", ">`", "\\", "10", ";", "\\", "10", ";", "Lay", "outs", ":", "\\", "10", ";", "\\", "10", ";", "-", " ", ":", "class", ":`", "Form", "Lay", "out", " ", "<", "lino", ".", "core", ".", "layouts", ".", "Form", "Lay", "out", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Pane", "l", " ", "<", "lino", ".", "core", ".", "layouts", ".", "Pane", "l", ">`", "\\", "10", ";", "\\", "10", ";", "Utili", "ties", ":", "\\", "10", ";", "\\", "10", ";", "-", " ", ":", "func", ":`", "obj2", "str", " ", "<", "lino", ".", "core", ".", "util", "s", ".", "obj2", "str", ">`", "\\", "10", ";", "-", " ", ":", "func", ":`", "obj2", "unicode", " ", "<", "lino", ".", "core", ".", "util", "s", ".", "obj2", "unicode", ">`", "\\", "10", ";", "-", " ", ":", "func", ":`", "range", "\\u", "filter", " ", "<", "lino", ".", "core", ".", "util", "s", ".", "range", "\\u", "filter", ">`", ",", "\\", "10", ";", " ", " ", ":", "func", ":`", "inr", "ange", "\\u", "filter", " ", "<", "lino", ".", "core", ".", "util", "s", ".", "inr", "ange", "\\u", "filter", ">`", "\\", "10", ";", "-", " ", ":", "func", ":`", "full", "\\u", "model", "\\u", "name", " ", "<", "lino", ".", "core", ".", "util", "s", ".", "full", "\\u", "model", "\\u", "name", ">`", "\\", "10", ";", "-", " ", ":", "func", ":`", "fields", "\\u", "list", " ", "<", "lino", ".", "core", ".", "fields", ".", "fields", "\\u", "list", ">`", "\\", "10", ";", "-", " ", ":", "func", ":`", "choose", "r", " ", "<", "lino", ".", "util", "s", ".", "choose", "rs", ".", "choose", "r", ">`", "\\", "10", ";", "-", " ", ":", "class", ":", " ", "`", "Parameter", "Pane", "l", " ", "<", "lino", ".", "core", ".", "util", "s", ".", "Parameter", "Pane", "l", ">`", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", "Inter", "-", "app", " ", "relation", "s", ":", "\\", "10", ";", "\\", "10", ";", "-", " ", ":", "func", ":`", "resolve", "\\u", "field", " ", "<", "lino", ".", "core", ".", "util", "s", ".", "resolve", "\\u", "field", ">`", "\\", "10", ";", "-", " ", ":", "func", ":`", "resolve", "\\u", "model", " ", "<", "lino", ".", "core", ".", "util", "s", ".", "resolve", "\\u", "model", ">`", "\\", "10", ";", "-", " ", ":", "func", ":`", "resolve", "\\u", "app", " ", "<", "lino", ".", "core", ".", "util", "s", ".", "resolve", "\\u", "app", ">`", "\\", "10", ";", "-", " ", ":", "func", ":`", "update", "\\u", "field", " ", "<", "lino", ".", "core", ".", "inject", ".", "update", "\\u", "field", ">`", "\\", "10", ";", "-", " ", ":", "func", ":`", "inject", "\\u", "field", " ", "<", "lino", ".", "core", ".", "inject", ".", "inject", "\\u", "field", ">`", "\\", "10", ";", "-", " ", ":", "func", ":`", "inject", "\\u", "action", " ", "<", "lino", ".", "core", ".", "inject", ".", "inject", "\\u", "action", ">`", "\\", "10", ";", "-", " ", ":", "func", ":`", "update", "\\u", "model", " ", "<", "lino", ".", "core", ".", "inject", ".", "update", "\\u", "model", ">`", "\\", "10", ";", "\\", "10", ";", "-", " ", ":", "func", ":`", "inject", "\\u", "quick", "\\u", "add", "\\u", "buttons", " ", "<", "lino", ".", "core", ".", "inject", ".", "inject", "\\u", "quick", "\\u", "add", "\\u", "buttons", ">`", "\\", "10", ";", "\\", "10", ";", "Signal", "s", ":", "\\", "10", ";", "\\", "10", ";", "-", " ", "See", " ", ":", "ref", ":`", "lino", ".", "signal", "s", "`", "\\", "10", ";", "\\", "10", ";", "Action", "s", ":", "\\", "10", ";", "\\", "10", ";", "-", " ", ":", "class", ":`", "Action", " ", "<", "lino", ".", "core", ".", "action", "s", ".", "Action", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Change", "State", "Action", " ", "<", "lino", ".", "core", ".", "workf", "lows", ".", "Change", "State", "Action", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Noti", "fy", "ing", "Action", " ", "<", "lino", ".", "core", ".", "action", "s", ".", "Noti", "fy", "ing", "Action", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Merge", "Action", " ", "<", "lino", ".", "core", ".", "merge", ".", "Merge", "Action", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Show", "Sla", "ve", "Table", " ", "<", "lino", ".", "core", ".", "action", "s", ".", "Show", "Sla", "ve", "Table", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "Print", "Table", "Action", " ", "<", "lino", ".", "util", "s", ".", "app", "y", "\\u", "pod", ".", "Print", "Table", "Action", ">`", "\\", "10", ";", "\\", "10", ";", "Permi", "ssion", "s", ":", "\\", "10", ";", "\\", "10", ";", "-", " ", ":", "class", ":`", "User", "Group", "s", " ", "<", "lino", ".", "modl", "ib", ".", "users", ".", "mix", "ins", ".", "User", "Group", "s", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "User", "Levels", " ", "<", "lino", ".", "modl", "ib", ".", "users", ".", "mix", "ins", ".", "User", "Levels", ">`", "\\", "10", ";", "-", " ", ":", "func", ":`", "add", "\\u", "user", "\\u", "group", " ", "<", "lino", ".", "modl", "ib", ".", "users", ".", "mix", "ins", ".", "add", "\\u", "user", "\\u", "group", ">`", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";", "Work", "flow", "s", ":", "\\", "10", ";", "\\", "10", ";", "-", " ", ":", "class", ":`", "Work", "flow", " ", "<", "lino", ".", "core", ".", "workf", "lows", ".", "Work", "flow", ">`", "\\", "10", ";", "-", " ", ":", "class", ":`", "State", " ", "<", "lino", ".", "core", ".", "workf", "lows", ".", "State", ">`", "\\", "10", ";", "\\", "10", ";", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\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_", "print", "\\u", "function_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "import_", "logging_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "logger_", "=_", "logging_", "._", "get", "Logger_", "(_", "\\u\\u", "name\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Short", "cut", " ", "to", " ", "the", " ", "main", " ", "Lin", "o", " ", "logg", "er", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "logg", "er", ".", "info", "(\"", "20140", "227", " ", "dd", ".", "py", " ", "a", "\")", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "conf_", "import_", "settings_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "utils_", "._", "encoding_", "import_", "python", "\\u", "2", "\\u", "unicode", "\\u", "compatible_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "tables_", "import_", "Virt", "ual", "Table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "utils_", "import_", "resolve", "\\u", "model_", ",_", "Unre", "solved", "Model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "utils_", "import_", "resolve", "\\u", "app_", ",_", "require", "\\u", "app", "\\u", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "utils_", "import_", "resolve", "\\u", "field_", ",_", "get", "\\u", "field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "utils_", "import_", "obj2", "str_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "utils_", "import_", "obj2", "unicode_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "utils_", "import_", "range", "\\u", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "utils_", "import_", "inr", "ange", "\\u", "filter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "utils_", "import_", "full", "\\u", "model", "\\u", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "model_", "import_", "Model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\"", "Short", "cut", " ", "to", " ", ":", "class", ":`", "lino", ".", "core", ".", "model", ".", "Model", "`.", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "merge_", "import_", "Merge", "Action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "actors_", "import_", "Actor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "dbt", "ables_", "import_", "has", "\\u", "fk_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "dbt", "ables_", "import_", "Table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "fields_", "import_", "Field", "Do", "es", "Not", "Exist_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "import_", "models_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "frames_", "import_", "Frame_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "tables_", "import_", "Vent", "ilat", "ing", "Table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "actions_", "import_", "action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "actions_", "import_", "Action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "actions_", "import_", "Multipl", "e", "Row", "Action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "actions_", "import_", "Show", "Sla", "ve", "Table_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "actions_", "import_", "Grid", "Edit_", ",_", "Show", "Det", "ail", "Action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "actions_", "import_", "Insert", "Row_", ",_", "Delete", "Selected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "actions_", "import_", "Submit", "Detail_", ",_", "Submit", "Insert_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "choice", "lists_", "import_", "Choi", "ce", "List_", ",_", "Choice_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "workflows_", "import_", "State_", ",_", "Workflow_", ",_", "Change", "State", "Action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "actions_", "import_", "Noti", "fy", "ing", "Action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "fields", "\\u", "list_", ",_", "Imported", "Fields_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Dummy_", ",_", "Du", "mm", "y", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "20140", "314", " ", "need", " ", "a", " ", "Du", "mm", "y", " ", "object", " ", "to", " ", "defin", "e", " ", "a", " ", "dummy", " ", "module_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "lino", ".", "core", ".", "layouts", " ", "import", " ", "Base", "Lay", "out", " ", "as", " ", "Du", "mm", "y", " ", " ", "#", " ", "20140", "314", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "lino", ".", "core", ".", "actors", " ", "import", " ", "Act", "or", " ", "as", " ", "Du", "mm", "y", " ", " ", "#", " ", "20140", "314", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Custom", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Recurren", "ce", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Incomp", "lete", "Date", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Date", "Picke", "r", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Null", "Char", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Passw", "ord", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Mont", "h", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Perce", "nta", "ge", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "~", " ", "from", " ", "lino", ".", "core", ".", "fields", " ", "import", " ", "Linke", "d", "Fore", "ign", "Key_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Quanti", "ty", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Dur", "ation", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Ht", "ml", "Box_", ",_", "Price", "Field_", ",_", "Rich", "Text", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Display", "Field_", ",_", "display", "field_", ",_", "html", "box_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Virt", "ual", "Field_", ",_", "virtual", "field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Request", "Field_", ",_", "request", "field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Constant_", ",_", "constant_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Fore", "ign", "Key_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "fields_", "import_", "Char", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "from", " ", "lino", "\\u", "xl", ".", "lib", ".", "app", "ypo", "d", ".", "mix", "ins", " ", "import", " ", "Print", "Table", "Action_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "utils_", "import_", "babel", "kw_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "from", " ", "lino", ".", "core", ".", "util", "s", " ", "import", " ", "babel", "attr_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "utils_", "import_", "babel", "\\u", "values_", "#", " ", "alias", " ", "for", " ", "babel", "kw", " ", "for", " ", "back", "ward", " ", "compat_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "utils_", "._", "choose", "rs_", "import_", "chooser_", ",_", "action", "\\u", "chooser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "layouts", "_", "import_", "Form", "Layout_", ",_", "Det", "ail", "Layout_", ",_", "Insert", "Layout_", ",_", "Panel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "layouts", "_", "import_", "Param", "s", "Layout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "layouts", "_", "import_", "Du", "mm", "y", "Panel_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "signals_", "import_", "on", "\\u", "ui", "\\u", "created_", ",_", "pre", "\\u", "ui", "\\u", "delete_", ",_", "on", "\\u", "ui", "\\u", "updated_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "signals_", "import_", "databa", "se", "\\u", "connected_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "signals_", "import_", "databa", "se", "\\u", "ready_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "signals_", "import_", "pre", "\\u", "startup_", ",_", "post", "\\u", "startup_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "signals_", "import_", "pre", "\\u", "analyze_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "signals_", "import_", "post", "\\u", "analyze_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "signals_", "import_", "auto", "\\u", "create_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "signals_", "import_", "pre", "\\u", "merge_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "signals_", "import_", "pre", "\\u", "add", "\\u", "child_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "signals_", "import_", "pre", "\\u", "remove", "\\u", "child_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "signals_", "import_", "pre", "\\u", "ui", "\\u", "build_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "signals_", "import_", "post", "\\u", "ui", "\\u", "build_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "signals_", "import_", "pre", "\\u", "save_", ",_", "post", "\\u", "save_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "signals_", "import_", "pre", "\\u", "init_", ",_", "post", "\\u", "init_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "signals_", "import_", "class", "\\u", "prepared", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "backends_", "._", "signals_", "import_", "connecti", "on", "\\u", "created_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "dispatch_", "import_", "receiver_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "~", " ", "from", " ", "lino", ".", "core", " ", "import", " ", "signals_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "django_", "._", "db_", "._", "models_", "._", "fields_", "import_", "NOT", "\\u", "PROVI", "DED", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "~", " ", "class", " ", "Modul", "e", "(", "object", "):", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "~", " ", "pass_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "inject_", "import_", "inject", "\\u", "action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "inject_", "import_", "inject", "\\u", "field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "inject_", "import_", "update", "\\u", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "inject_", "import_", "update", "\\u", "field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "inject_", "import_", "inject", "\\u", "quick", "\\u", "add", "\\u", "buttons_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "inject_", "import_", "do", "\\u", "whe", "n", "\\u", "prepared", "_", ",_", "whe", "n", "\\u", "prepared", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "utils_", "import_", "Parameter", "Panel_", ",_", "Pse", "udo", "Request_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "from", " ", "lino", ".", "modl", "ib", ".", "users", ".", "choice", "lists", " ", "import", " ", "User", "Levels", ",", " ", "User", "Groups_", "\\u\\u\\uNL\\u\\u\\u_", "#", "from", " ", "lino", ".", "modl", "ib", ".", "users", ".", "util", "s", " ", "import", " ", "add", "\\u", "user", "\\u", "group_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "utils_", "import_", "Incomp", "lete", "Date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "utils_", "._", "format\\u", "date_", "import_", "fd", "m_", ",_", "fd", "l_", ",_", "fdf", "_", ",_", "fd", "my_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "utils_", "._", "format\\u", "date_", "import_", "fds_", "as_", "fds", "\\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_", "#", " ", "back", "ward", " ", "compatibility", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "dto", "s_", "=_", "fds_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "utils_", "._", "format\\u", "date_", "import_", "fd", "l_", "as_", "dto", "sl_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "babel", "item_", "=_", "settings_", "._", "SITE", "_", "._", "babel", "item_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "field", "2", "kw_", "=_", "settings_", "._", "SITE", "_", "._", "field", "2", "kw_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "utils_", "._", "mld", "bc_", "._", "fields_", "import_", "Bab", "el", "Text", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "lino", "_", "._", "utils_", "._", "mld", "bc_", "._", "fields_", "import_", "Bab", "el", "Char", "Field_", ",_", "Lang", "ua", "ge", "Field_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "modl", "ib_", "._", "system_", "._", "choice", "lists_", "import_", "Gen", "ders", "_", ",_", "Period", "Events_", ",_", "Ye", "s", "No_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "importlib_", "import_", "import", "\\u", "module_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "The", " ", "follow", "ing", " ", "are", " ", "not", " ", "only", " ", "shortcut", "s", ",", " ", "the", "y", " ", "als", "o", " ", "are", " ", "a", " ", "preparation", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "encapsulat", "e", " ", "the", " ", "`", "settings", ".", "SITE", "`", " ", "name", ".", " ", "It", " ", "is", " ", "possib", "le", " ", "tha", "t", " ", "after_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Dj", "ang", "o", " ", "1.7", " ", "we", " ", "no", " ", "long", "er", " ", "need", " ", "a", " ", "`", "settings", ".", "SITE", "`.", " ", "So", " ", "I", " ", "plan", " ", "to_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "depre", "cate", " ", "direct", " ", "access", " ", "to", " ", "settings", ".", "SITE", " ", "in", " ", "applica", "tion", " ", "code", ".", " ", "I", " ", "am_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "not", " ", "ye", "t", " ", "100", "%", " ", "sure", " ", "whe", "ther", " ", "this", " ", "will", " ", "be", " ", "possib", "le", " ", "and", " ", "make", "s", " ", "sense", "._", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "dec", "fmt_", "=_", "settings_", "._", "SITE", "_", "._", "dec", "fmt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "str2", "kw_", "=_", "settings_", "._", "SITE", "_", "._", "str2", "kw_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "toda", "y", " ", "=", " ", "settings", ".", "SITE", ".", "today_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "strftime_", "=_", "settings_", "._", "SITE", "_", "._", "strftime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "demo", "\\u", "date_", "=_", "settings_", "._", "SITE", "_", "._", "demo", "\\u", "date_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "abstract", "\\u", "model_", "=_", "settings_", "._", "SITE", "_", "._", "is", "\\u", "abstract", "\\u", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "is", "\\u", "installed_", "=_", "settings_", "._", "SITE", "_", "._", "is", "\\u", "installed_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", "\\u", "db", "\\u", "over", "view", "\\u", "rst", " ", "=", " ", "settings", ".", "SITE", ".", "get", "\\u", "db", "\\u", "over", "view", "\\u", "rst_", "\\u\\u\\uNL\\u\\u\\u_", "add", "\\u", "welcome", "\\u", "handler_", "=_", "settings_", "._", "SITE", "_", "._", "add", "\\u", "welcome", "\\u", "handler_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "build", "\\u", "media", "\\u", "url_", "=_", "settings_", "._", "SITE", "_", "._", "build", "\\u", "media", "\\u", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "build", "\\u", "static", "\\u", "url_", "=_", "settings_", "._", "SITE", "_", "._", "build", "\\u", "static", "\\u", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "default", "\\u", "language_", "=_", "settings_", "._", "SITE", "_", "._", "get", "\\u", "default", "\\u", "language_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "resolve", "\\u", "languages_", "=_", "settings_", "._", "SITE", "_", "._", "resolve", "\\u", "languages_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "babel", "attr_", "=_", "settings_", "._", "SITE", "_", "._", "babel", "attr_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "apps_", "=_", "plugins_", "=_", "settings_", "._", "SITE", "_", "._", "plugins_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "`", "apps", "`", " ", "is", " ", "an", " ", "alias", " ", "for", " ", "`", "plugin", "s", "`.", " ", "We", " ", "recommend", " ", "plugin", "s", " ", "sinc", "e", " ", "`", "apps", "`_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "is", " ", "bei", "ng", " ", "used", " ", "by", " ", "Dj", "ang", "o", " ", "1.7", "_", "\\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\\uDEDENT\\u\\u\\u_", "from_", "django_", "._", "utils_", "import_", "translation_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "get", "\\u", "language_", "=_", "translation_", "._", "get", "\\u", "language_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "lino", "_", "._", "core_", "._", "roles_", "import_", "Site", "Sta", "ff_", ",_", "Site", "User_", ",_", "Site", "Admin_", ",_", "login", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "depre", "cated", " ", "alias", "es", ":_", "\\u\\u\\uNL\\u\\u\\u_", "Required_", "=_", "required_", "=_", "login", "\\u", "required_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "logg", "er", ".", "info", "(\"", "20140", "227", " ", "dd", ".", "py", " ", "b", " ", "%", "s", "\",", " ", "site", ")_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "fds_", "(_", "d_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Add", "s", " ", "support", " ", "for", " ", ":", "class", ":`", "lino", ".", "fields", ".", "Incomp", "lete", "Date", "`.", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "isinstance_", "(_", "d_", ",_", "Incomp", "lete", "Date_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "fds", "\\u_", "(_", "d_", "._", "as", "\\u", "date_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "fds", "\\u_", "(_", "d_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "today_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "make", " ", "it", " ", "serializable", " ", "for", " ", "Dj", "ang", "o", " ", "migrations_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "settings_", "._", "SITE", "_", "._", "today_", "(_", "*_", "args_", ",_", "**_", "kwargs_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "def_", "resolve", "\\u", "plugin_", "(_", "app", "\\u", "label_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "plugins_", "._", "get_", "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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 ]
Imprecise assert
openstack/rally/tests/functional/test_cli_task.py
[ { "content": " def _test_start_abort_on_sla_failure(self, cfg, times):\n rally = utils.Rally()\n deployment_id = utils.get_global(\"RALLY_DEPLOYMENT\", rally.env)\n config = utils.TaskConfig(cfg)\n rally((\"task start --task %(task_file)s \"\n \"--deployment %(deployment_id)s --abort-on-sla-failure\") %\n {\"task_file\": config.filename,\n \"deployment_id\": deployment_id})\n results = json.loads(rally(\"task results\"))\n iterations_completed = len(results[0][\"result\"])\n self.assertTrue(iterations_completed < times)", "metadata": "root.TaskTestCase._test_start_abort_on_sla_failure", "header": "['class', 'TaskTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 522 }, { "content": " def test_abort(self):\n RUNNER_TIMES = 10\n cfg = {\n \"Dummy.dummy\": [\n {\n \"args\": {\n \"sleep\": 5\n },\n \"runner\": {\n \"type\": \"serial\",\n \"times\": RUNNER_TIMES\n }\n }\n ]\n }\n rally = utils.Rally()\n task, uuid = self._start_task_in_new_thread(\n rally, cfg, \"test_abort-thread_with_abort.txt\")\n rally(\"task abort %s\" % uuid)\n task.join()\n results = json.loads(rally(\"task results\"))\n iterations_completed = len(results[0][\"result\"])\n # NOTE(msdubov): check that the task is really stopped before\n # the specified number of iterations\n self.assertTrue(iterations_completed < RUNNER_TIMES)\n self.assertIn(\"aborted\", rally(\"task status\"))\n report = rally.gen_report_path(extension=\"html\")\n rally(\"task report --out %s\" % report)", "metadata": "root.TaskTestCase.test_abort", "header": "['class', 'TaskTestCase', '(', 'unittest', '.', 'TestCase', ')', ':', '___EOS___']", "index": 678 } ]
[ { "span": "self.assertTrue(iterations_completed < times)", "start_line": 532, "start_column": 8, "end_line": 532, "end_column": 53 }, { "span": "self.assertTrue(iterations_completed < RUNNER_TIMES)", "start_line": 702, "start_column": 8, "end_line": 702, "end_column": 60 } ]
[]
1
true
[ "[CLS]_", "Imp", "reci", "se_", "assert_", "[SEP]_", "class_", "Task", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "\\u", "test\\u", "start", "\\u", "abort", "\\u", "on", "\\u", "sla", "\\u", "failure_", "(_", "self_", ",_", "cfg_", ",_", "times_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "rally", "_", "=_", "utils_", "._", "Ra", "ll", "y_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "deploy", "ment", "\\u", "id_", "=_", "utils_", "._", "get", "\\u", "global_", "(_", "\"", "RAL", "LY", "\\u", "DEPLOY", "MENT", "\"_", ",_", "rally", "_", "._", "env_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "config_", "=_", "utils_", "._", "Task", "Config_", "(_", "cfg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rally", "_", "(_", "(_", "\"", "task", " ", "start", " ", "--", "task", " ", "%", "(", "task", "\\u", "file", ")", "s", " ", "\"_", "\\u\\u\\uNL\\u\\u\\u_", "\"--", "deploy", "ment", " ", "%", "(", "deploy", "ment", "\\u", "id", ")", "s", " ", "--", "abort", "-", "on", "-", "sla", "-", "fail", "ure", "\"_", ")_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\"", "task", "\\u", "file", "\"_", ":_", "config_", "._", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "deploy", "ment", "\\u", "id", "\"_", ":_", "deploy", "ment", "\\u", "id_", "}_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "json_", "._", "loads_", "(_", "rally", "_", "(_", "\"", "task", " ", "results", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iterati", "ons", "\\u", "completed_", "=_", "len_", "(_", "results_", "[_", "0_", "]_", "[_", "\"", "result", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "iterati", "ons", "\\u", "completed_", "<_", "times_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Task", "Test", "Case_", "(_", "unittest_", "._", "Test", "Case_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "test\\u", "abort_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "RUNN", "ER", "\\u", "TIMES", "_", "=_", "10_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cfg_", "=_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "Du", "mm", "y", ".", "dummy", "\"_", ":_", "[_", "\\u\\u\\uNL\\u\\u\\u_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "args", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "sleep", "\"_", ":_", "5_", "\\u\\u\\uNL\\u\\u\\u_", "}_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "runn", "er", "\"_", ":_", "{_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "type", "\"_", ":_", "\"", "serial", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "times", "\"_", ":_", "RUNN", "ER", "\\u", "TIMES", "_", "\\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_", "rally", "_", "=_", "utils_", "._", "Ra", "ll", "y_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task_", ",_", "uuid_", "=_", "self_", "._", "\\u", "start", "\\u", "task", "\\u", "in", "\\u", "new", "\\u", "thread_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "rally", "_", ",_", "cfg_", ",_", "\"", "test\\u", "abort", "-", "thread", "\\u", "with", "\\u", "abort", ".", "txt", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rally", "_", "(_", "\"", "task", " ", "abort", " ", "%", "s", "\"_", "%_", "uuid_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "task_", "._", "join_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "results_", "=_", "json_", "._", "loads_", "(_", "rally", "_", "(_", "\"", "task", " ", "results", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "iterati", "ons", "\\u", "completed_", "=_", "len_", "(_", "results_", "[_", "0_", "]_", "[_", "\"", "result", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "NOTE", "(", "msd", "ub", "ov", "):", " ", "check", " ", "tha", "t", " ", "the", " ", "task", " ", "is", " ", "reall", "y", " ", "stopp", "ed", " ", "before_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "the", " ", "specified", " ", "number", " ", "of", " ", "iterations_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "assert", "True_", "(_", "iterati", "ons", "\\u", "completed_", "<_", "RUNN", "ER", "\\u", "TIMES", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "assert", "In_", "(_", "\"", "abort", "ed", "\"_", ",_", "rally", "_", "(_", "\"", "task", " ", "status", "\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "report_", "=_", "rally", "_", "._", "gen", "\\u", "report", "\\u", "path_", "(_", "extension_", "=_", "\"", "html", "\"_", ")_", "\\u\\u\\uNEWLINE\\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, 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 ]
Unnecessary pass
hwaf/hwaf/py-hwaftools/hwaf-system.py
[ { "content": "def configure(ctx):\n\n #ctx.load('c_config')\n #ctx.load('compiler_cc')\n #ctx.load('compiler_cxx')\n\n variant = os.environ.get('HWAF_VARIANT', os.environ.get('CMTCFG', None))\n if not variant and ctx.options.variant:\n variant = ctx.options.variant\n pass\n\n cfg_arch = None\n cfg_os = None\n cfg_comp = 'gcc'\n cfg_type = None\n \n if not variant or variant == 'default':\n msg.debug('hwaf: detecting default HWAF_VARIANT...')\n cfg_type = 'opt'\n if ctx.is_darwin(): cfg_os = 'darwin'\n elif ctx.is_linux(): cfg_os = 'linux'\n elif ctx.is_freebsd(): cfg_os = 'freebsd'\n else: cfg_os = 'win'\n \n\n if ctx.is_host_32b(): cfg_arch = 'i686'\n elif ctx.is_host_64b(): cfg_arch = 'x86_64'\n else: cfg_arch = 'x86_64'\n\n variant = '-'.join([cfg_arch, cfg_os,\n cfg_comp, cfg_type])\n pass\n \n o = variant.split('-')\n if len(o) != 4:\n ctx.fatal(\n (\"Invalid HWAF_VARIANT (%s). Expected ARCH-OS-COMP-OPT. \" +\n \"ex: x86_64-linux-gcc-opt\") %\n variant)\n \n if o[1].startswith('mac'): o[1] = 'darwin'\n if o[1].startswith('slc'): o[1] = 'linux'\n\n #if o[2].startswith('gcc'):\n # o[2] = 'gcc'\n\n ctx.env.HWAF_VARIANT = variant\n ctx.env.CFG_QUADRUPLET = o\n \n ctx.env.CFG_ARCH, \\\n ctx.env.CFG_OS, \\\n ctx.env.CFG_COMPILER, \\\n ctx.env.CFG_TYPE = ctx.env.CFG_QUADRUPLET\n\n projname = waflib.Context.g_module.APPNAME\n if not projname:\n projname = osp.basename(os.getcwd())\n waflib.Context.g_module.APPNAME = projname\n pass\n ctx.env.HWAF_PROJECT_NAME = projname\n\n projvers = waflib.Context.g_module.VERSION\n if ctx.options.project_version:\n projvers = ctx.options.project_version\n pass\n waflib.Context.g_module.VERSION = projvers\n ctx.env.HWAF_PROJECT_VERSION = projvers\n \n if not ctx.env.HWAF_TAGS: ctx.env['HWAF_TAGS'] = {}\n if not ctx.env.HWAF_ACTIVE_TAGS: ctx.env['HWAF_ACTIVE_TAGS'] = []\n if not ctx.env.HWAF_PATH_VARS: ctx.env['HWAF_PATH_VARS'] = []\n\n pkgdir = os.environ.get('PKGDIR', None)\n if not pkgdir and ctx.options.pkgdir:\n pkgdir = ctx.options.pkgdir\n pass\n if not pkgdir:\n pkgdir = 'src'\n pass\n ctx.env.PKGDIR = pkgdir\n\n if ctx.options.destdir:\n ctx.env.DESTDIR = ctx.options.destdir\n pass\n\n ctx.env.PREFIX = ctx.options.prefix or \"/usr\"\n ctx.env.PREFIX = osp.abspath(ctx.env.get_flat('PREFIX'))\n\n relocate_from = ctx.options.relocate_from\n if not relocate_from:\n relocate_from = ctx.env.PREFIX\n pass\n ctx.env.HWAF_RELOCATE = relocate_from\n \n # take INSTALL_AREA from PREFIX\n ctx.env.INSTALL_AREA = ctx.env.PREFIX\n if ctx.env.DESTDIR:\n pass\n\n # percolate HWAF_VARIANT\n ctx.hwaf_declare_tag(ctx.env.HWAF_VARIANT, content=ctx.env.HWAF_VARIANT.split(\"-\"))\n ctx.hwaf_apply_tag(ctx.env.HWAF_VARIANT)\n\n # backward compat\n ctx.env.CMTCFG = ctx.env.HWAF_VARIANT\n return", "metadata": "root.configure", "header": "['module', '___EOS___']", "index": 40 } ]
[ { "span": "pass", "start_line": 49, "start_column": 8, "end_line": 49, "end_column": 12 }, { "span": "pass", "start_line": 71, "start_column": 8, "end_line": 71, "end_column": 12 }, { "span": "pass", "start_line": 98, "start_column": 8, "end_line": 98, "end_column": 12 }, { "span": "pass", "start_line": 104, "start_column": 8, "end_line": 104, "end_column": 12 }, { "span": "pass", "start_line": 115, "start_column": 8, "end_line": 115, "end_column": 12 }, { "span": "pass", "start_line": 118, "start_column": 8, "end_line": 118, "end_column": 12 }, { "span": "pass", "start_line": 123, "start_column": 8, "end_line": 123, "end_column": 12 }, { "span": "pass", "start_line": 131, "start_column": 8, "end_line": 131, "end_column": 12 } ]
[]
1
true
[ "[CLS]_", "Un", "necessar", "y_", "pass_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "configure_", "(_", "ctx_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "ctx", ".", "load", "('", "c\\u", "config", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "ctx", ".", "load", "('", "compiler", "\\u", "cc", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", "ctx", ".", "load", "('", "compiler", "\\u", "cxx", "')", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "variant_", "=_", "os_", "._", "environ_", "._", "get_", "(_", "'", "HW", "AF", "\\u", "VARIAN", "T", "'_", ",_", "os_", "._", "environ_", "._", "get_", "(_", "'", "CM", "TC", "FG", "'_", ",_", "None_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "variant_", "and_", "ctx_", "._", "options_", "._", "variant_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "variant_", "=_", "ctx_", "._", "options_", "._", "variant_", "\\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_", "cfg", "\\u", "arch_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cfg", "\\u", "os_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cfg", "\\u", "comp_", "=_", "'", "gcc", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cfg", "\\u", "type_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "variant_", "or_", "variant_", "==_", "'", "default", "'_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "msg_", "._", "debug_", "(_", "'", "hwa", "f", ":", " ", "detect", "ing", " ", "default", " ", "HW", "AF", "\\u", "VARIAN", "T", "...'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cfg", "\\u", "type_", "=_", "'", "opt", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ctx_", "._", "is", "\\u", "dar", "win_", "(_", ")_", ":_", "cfg", "\\u", "os_", "=_", "'", "dar", "win", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elif_", "ctx_", "._", "is", "\\u", "linux_", "(_", ")_", ":_", "cfg", "\\u", "os_", "=_", "'", "linux", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elif_", "ctx_", "._", "is", "\\u", "freeb", "sd_", "(_", ")_", ":_", "cfg", "\\u", "os_", "=_", "'", "freeb", "sd", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "cfg", "\\u", "os_", "=_", "'", "win", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ctx_", "._", "is", "\\u", "host", "\\u", "32", "b_", "(_", ")_", ":_", "cfg", "\\u", "arch_", "=_", "'", "i", "686", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "elif_", "ctx_", "._", "is", "\\u", "host", "\\u", "64", "b_", "(_", ")_", ":_", "cfg", "\\u", "arch_", "=_", "'", "x8", "6", "\\u", "64", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "else_", ":_", "cfg", "\\u", "arch_", "=_", "'", "x8", "6", "\\u", "64", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "variant_", "=_", "'-'_", "._", "join_", "(_", "[_", "cfg", "\\u", "arch_", ",_", "cfg", "\\u", "os_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "cfg", "\\u", "comp_", ",_", "cfg", "\\u", "type_", "]_", ")_", "\\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_", "o_", "=_", "variant_", "._", "split_", "(_", "'-'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "o_", ")_", "!=_", "4_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "fatal_", "(_", "\\u\\u\\uNL\\u\\u\\u_", "(_", "\"", "Inva", "lid", " ", "HW", "AF", "\\u", "VARIAN", "T", " ", "(%", "s", ").", " ", "Expect", "ed", " ", "ARCH", "-", "OS", "-", "COMP", "-", "OPT", ".", " ", "\"_", "+_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "ex", ":", " ", "x8", "6", "\\u", "64", "-", "linux", "-", "gcc", "-", "opt", "\"_", ")_", "%_", "\\u\\u\\uNL\\u\\u\\u_", "variant_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "o_", "[_", "1_", "]_", "._", "startswith_", "(_", "'", "mac", "'_", ")_", ":_", "o_", "[_", "1_", "]_", "=_", "'", "dar", "win", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "o_", "[_", "1_", "]_", "._", "startswith_", "(_", "'", "slc", "'_", ")_", ":_", "o_", "[_", "1_", "]_", "=_", "'", "linux", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", "if", " ", "o", "[", "2", "].", "startswith", "('", "gcc", "')", ":_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", " ", " ", " ", "o", "[", "2", "]", " ", "=", " ", "'", "gcc", "'_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "VARIAN", "T_", "=_", "variant_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "._", "CF", "G", "\\u", "QUA", "DR", "UP", "LET", "_", "=_", "o_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "env_", "._", "CF", "G", "\\u", "ARCH", "_", ",_", "ctx_", "._", "env_", "._", "CF", "G", "\\u", "OS_", ",_", "ctx_", "._", "env_", "._", "CF", "G", "\\u", "COMPILER", "_", ",_", "ctx_", "._", "env_", "._", "CF", "G", "\\u", "TYPE_", "=_", "ctx_", "._", "env_", "._", "CF", "G", "\\u", "QUA", "DR", "UP", "LET", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "proj", "name_", "=_", "waf", "lib_", "._", "Context_", "._", "g", "\\u", "module_", "._", "APP", "NAME_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "proj", "name_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proj", "name_", "=_", "osp_", "._", "basename_", "(_", "os_", "._", "getcwd_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "waf", "lib_", "._", "Context_", "._", "g", "\\u", "module_", "._", "APP", "NAME_", "=_", "proj", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "PROJECT", "\\u", "NAME_", "=_", "proj", "name_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "proj", "vers_", "=_", "waf", "lib_", "._", "Context_", "._", "g", "\\u", "module_", "._", "VERSION_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ctx_", "._", "options_", "._", "project", "\\u", "version_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "proj", "vers_", "=_", "ctx_", "._", "options_", "._", "project", "\\u", "version_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "waf", "lib_", "._", "Context_", "._", "g", "\\u", "module_", "._", "VERSION_", "=_", "proj", "vers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "PROJECT", "\\u", "VERSION_", "=_", "proj", "vers_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "not_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "TAGS_", ":_", "ctx_", "._", "env_", "[_", "'", "HW", "AF", "\\u", "TAG", "S", "'_", "]_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "ACTI", "VE", "\\u", "TAGS_", ":_", "ctx_", "._", "env_", "[_", "'", "HW", "AF", "\\u", "ACTI", "VE", "\\u", "TAG", "S", "'_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "PATH", "\\u", "VARS", "_", ":_", "ctx_", "._", "env_", "[_", "'", "HW", "AF", "\\u", "PATH", "\\u", "VARS", "'_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "pkgd", "ir_", "=_", "os_", "._", "environ_", "._", "get_", "(_", "'", "PKG", "DIR", "'_", ",_", "None_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "pkgd", "ir_", "and_", "ctx_", "._", "options_", "._", "pkgd", "ir_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pkgd", "ir_", "=_", "ctx_", "._", "options_", "._", "pkgd", "ir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "not_", "pkgd", "ir_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pkgd", "ir_", "=_", "'", "src", "'_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctx_", "._", "env_", "._", "PKG", "DIR_", "=_", "pkgd", "ir_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "ctx_", "._", "options_", "._", "destdir_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "ctx_", "._", "env_", "._", "DEST", "DIR_", "=_", "ctx_", "._", "options_", "._", "destdir_", "\\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_", "ctx_", "._", "env_", "._", "PREFIX_", "=_", "ctx_", "._", "options_", "._", "prefix_", "or_", "\"/", "usr", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "env_", "._", "PREFIX_", "=_", "osp_", "._", "abspath_", "(_", "ctx_", "._", "env_", "._", "get", "\\u", "flat_", "(_", "'", "PREF", "IX", "'_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "relocat", "e\\u", "from_", "=_", "ctx_", "._", "options_", "._", "relocat", "e\\u", "from_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "relocat", "e\\u", "from_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "relocat", "e\\u", "from_", "=_", "ctx_", "._", "env_", "._", "PREFIX_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "REL", "OC", "ATE_", "=_", "relocat", "e\\u", "from_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "take", " ", "INSTA", "LL", "\\u", "AREA", " ", "from", " ", "PREFIX_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "env_", "._", "INSTA", "LL", "\\u", "AREA", "_", "=_", "ctx_", "._", "env_", "._", "PREFIX_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "ctx_", "._", "env_", "._", "DEST", "DIR_", ":_", "\\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_", "#", " ", "perc", "ola", "te", " ", "HW", "AF", "\\u", "VARIAN", "T_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "ctx_", "._", "hwa", "f", "\\u", "declar", "e\\u", "tag_", "(_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "VARIAN", "T_", ",_", "content_", "=_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "VARIAN", "T_", "._", "split_", "(_", "\"-\"_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ctx_", "._", "hwa", "f", "\\u", "appl", "y", "\\u", "tag_", "(_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "VARIAN", "T_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "back", "ward", " ", "compat_", "\\u\\u\\uNL\\u\\u\\u_", "ctx_", "._", "env_", "._", "CM", "TC", "FG", "_", "=_", "ctx_", "._", "env_", "._", "HW", "AF", "\\u", "VARIAN", "T_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_" ]
[ 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 ]
Unused import
sahana/eden/modules/tests/smoke/broken_links.py
[ { "content": "\"\"\" Sahana Eden Test Framework\n\n @copyright: 2011-2016 (c) Sahana Software Foundation\n @license: MIT\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation\n files (the \"Software\"), to deal in the Software without\n restriction, including without limitation the rights to use,\n copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the\n Software is furnished to do so, subject to the following\n conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n OTHER DEALINGS IN THE SOFTWARE.\n\"\"\"\n\nfrom time import time\ntry:\n from cStringIO import StringIO # Faster, where available\nexcept:\n from StringIO import StringIO\nimport sys\nimport socket\n\nfrom tests.web2unittest import Web2UnitTest\nfrom gluon import current\ntry:\n from twill import get_browser\n from twill import set_output\n from twill.browser import *\nexcept ImportError:\n raise NameError(\"Twill not installed\")\ntry:\n import mechanize\n #from mechanize import BrowserStateError\n #from mechanize import ControlNotFoundError\nexcept ImportError:\n raise NameError(\"Mechanize not installed\")\n\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class BrokenLinkTest(Web2UnitTest):\n \"\"\" Smoke Test, visit every link it can find and report on the outcome \"\"\"\n\n\n\n\n\n# socket.setdefaulttimeout(value*2)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "metadata": "root.BrokenLinkTest", "header": "['module', '___EOS___']", "index": 50 }, { "content": " def __init__(self):\n Web2UnitTest.__init__(self)\n self.b = get_browser()\n self.b_data = StringIO()\n set_output(self.b_data)\n self.clearRecord()\n # This string must exist in the URL for it to be followed\n # Useful to avoid going to linked sites\n self.homeURL = self.url\n # Link used to identify a URL to a ticket\n self.url_ticket = \"/admin/default/ticket/\"\n # Tuple of strings that if in the URL will be ignored\n # Useful to avoid dynamic URLs that trigger the same functionality\n self.include_ignore = (\"_language=\",\n \"logout\",\n \"appadmin\",\n \"admin\",\n \"delete\",\n )\n # tuple of strings that should be removed from the URL before storing\n # Typically this will be some variables passed in via the URL\n self.strip_url = (\"?_next=\",\n )\n self.reportOnly = False\n self.maxDepth = 16 # sanity check\n self.setThreshold(10)\n self.setUser(\"test@example.com/eden\")\n self.total_visited = 0\n self.broken_links_count = 0", "metadata": "root.BrokenLinkTest.__init__", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 52 }, { "content": " def clearRecord(self):\n # the total url links visited\n self.totalLinks = 0\n # The number of unique urls found at depth i, where i is the index\n self.linkDepth = []\n # Dictionary of the parent for each URL\n self.urlParentList = {}\n # dictionary of ReportData objects indexed on the url\n self.results = {}", "metadata": "root.BrokenLinkTest.clearRecord", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 82 }, { "content": " def setReportOnly(self, action):\n self.reportOnly = action", "metadata": "root.BrokenLinkTest.setReportOnly", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 92 }, { "content": " def setDepth(self, depth):\n self.maxDepth = depth", "metadata": "root.BrokenLinkTest.setDepth", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 95 }, { "content": " def setUser(self, user):\n self.credentials = user.split(\",\")", "metadata": "root.BrokenLinkTest.setUser", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 98 }, { "content": " def setThreshold(self, value):\n value = float(value)\n self.threshold = value", "metadata": "root.BrokenLinkTest.setThreshold", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 101 }, { "content": " def login(self, credentials):\n if credentials == \"UNAUTHENTICATED\":\n url = \"%s/default/user/logout\" % self.homeURL\n self.b.go(url)\n return True\n try:\n (self.user, self.password) = credentials.split(\"/\",1)\n except:\n msg = \"Unable to split %s into a user name and password\" % user\n self.reporter(msg)\n return False\n url = \"%s/default/user/login\" % self.homeURL\n self.b.go(url)\n forms = self.b.get_all_forms()\n for form in forms:\n try:\n if form[\"_formname\"] == \"login\":\n self.b._browser.form = form\n form[\"email\"] = self.user\n form[\"password\"] = self.password\n self.b.submit(\"Login\")\n # If login is successful then should be redirected to the homepage\n return self.b.get_url()[len(self.homeURL):] == \"/default/index\"\n except:\n # This should be a mechanize.ControlNotFoundError, but\n # for some unknown reason that isn't caught on Windows or Mac\n pass\n return False", "metadata": "root.BrokenLinkTest.login", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 106 }, { "content": " def addResults2Current(self):\n '''\n Store the count links in gluon.current to be used by HTMLTestRunner for better reporting\n '''\n smoke_results = {}\n smoke_results['working_links'] = self.total_visited - self.broken_links_count\n smoke_results['broken_links_count'] = self.broken_links_count\n current.data['smoke_results'] = smoke_results", "metadata": "root.BrokenLinkTest.addResults2Current", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 135 }, { "content": " def runTest(self):\n \"\"\"\n Test to find all exposed links and check the http code returned.\n\n This test doesn't run any javascript so some false positives\n will be found.\n\n The test can also display an histogram depicting the number of\n links found at each depth.\n\n Failure or Success to be shown in the report is checked in addSuccess in TestResult\n class\n \"\"\"\n for user in self.credentials:\n self.clearRecord()\n if self.login(user):\n self.reporter(\"Smoke Test for user %s\" % self.user)\n self.visitLinks()\n self.report()\n self.addResults2Current()\n else:\n raise Exception(\"Login Failed\")", "metadata": "root.BrokenLinkTest.runTest", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 144 }, { "content": " def visitLinks(self):\n url = self.homeURL + \"/default/index\"\n to_visit = [url]\n start = time()\n self.total_visited = 0\n if not self.reportOnly:\n for depth in range(self.maxDepth):\n if len(to_visit) == 0:\n break\n self.linkDepth.append(len(to_visit))\n self.totalLinks += len(to_visit)\n visit_start = time()\n url_visited = \"%d urls\" % len(to_visit)\n self.total_visited += len(to_visit)\n to_visit = self.visit(to_visit, depth)\n msg = \"%.2d Visited %s in %.3f seconds, %d more urls found\" % (depth, url_visited, time()-visit_start, len(to_visit))\n self.reporter(msg)\n if self.config.verbose >= 2:\n if self.config.verbose >= 3:\n print >> self.stdout\n if self.stdout.isatty(): # terminal should support colour\n msg = \"%.2d Visited \\033[1;32m%s\\033[0m in %.3f seconds, \\033[1;31m%d\\033[0m more urls found\" % (depth, url_visited, time()-visit_start, len(to_visit))\n print >> self.stdout, msg\n if len(to_visit) > 0:\n self.linkDepth.append(len(to_visit))\n finish = time()\n self.reporter(\"Finished took %.3f seconds\" % (finish - start))", "metadata": "root.BrokenLinkTest.visitLinks", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 167 }, { "content": " def visit(self, url_list, depth):\n repr_list = [\".pdf\", \".xls\", \".rss\", \".kml\"]\n to_visit = []\n record_data = self.config.verbose > 0\n for visited_url in url_list:\n index_url = visited_url[len(self.homeURL):]\n if record_data:\n if index_url in self.results.keys():\n print >> self.stdout, \"Warning duplicated url: %s\" % index_url\n self.results[index_url] = ReportData()\n current_results = self.results[index_url]\n current_results.depth = depth\n # Find out if the page can be visited\n open_novisit = False\n for repr in repr_list:\n if repr in index_url:\n open_novisit = True\n break\n try:\n if open_novisit:\n action = \"open_novisit\"\n else:\n action = \"open\"\n visit_start = time()\n self.b._journey(action, visited_url)\n http_code = self.b.get_code()\n duration = time() - visit_start\n if record_data:\n current_results.duration = duration\n if duration > self.threshold:\n if self.config.verbose >= 3:\n print >> self.stdout, \"%s took %.3f seconds\" % (visited_url, duration)\n except Exception as e:\n duration = time() - visit_start\n import traceback\n print traceback.format_exc()\n if record_data:\n current_results.broken = True\n current_results.exception = True\n current_results.duration = duration\n continue\n http_code = self.b.get_code()\n if http_code != 200:\n if record_data:\n current_results.broken = True\n current_results.http_code = http_code\n elif open_novisit:\n continue\n links = []\n try:\n if self.b._browser.viewing_html():\n links = self.b._browser.links()\n else:\n continue\n except Exception as e:\n import traceback\n print traceback.format_exc()\n if record_data:\n current_results.broken = True\n current_results.exception = True\n continue\n for link in (links):\n url = link.absolute_url\n if url.find(self.url_ticket) != -1:\n # A ticket was raised so...\n # capture the details and add to brokenLinks\n if record_data:\n current_results.broken = True\n current_results.ticket = url\n break # no need to check any other links on this page\n if url.find(self.homeURL) == -1:\n continue\n ignore_link = False\n for ignore in self.include_ignore:\n if url.find(ignore) != -1:\n ignore_link = True\n break\n if ignore_link:\n continue\n for strip in self.strip_url:\n location = url.find(strip)\n if location != -1:\n url = url[0:location]\n short_url = url[len(self.homeURL):]\n if url not in url_list and \\\n short_url != \"\" and \\\n short_url not in self.results.keys() and \\\n url not in to_visit:\n self.urlParentList[short_url] = index_url\n to_visit.append(url)\n return to_visit", "metadata": "root.BrokenLinkTest.visit", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 195 }, { "content": " def report(self):\n self.reporter(\"%d URLs visited\" % self.totalLinks)\n self.brokenReport()\n self.timeReport()\n if self.config.record_timings:\n if not self.reportOnly:\n self.record_timings()\n self.scatterplot()\n self.depthReport()", "metadata": "root.BrokenLinkTest.report", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 287 }, { "content": " def record_timings(self):\n import_error = \"\"\n try:\n import xlrd\n except:\n import_error += \"ERROR: the xlrd modules is needed to record timings\\n\"\n try:\n import xlwt\n except:\n import_error += \"ERROR: the xlwt modules is needed to record timings\\n\"\n if import_error != \"\":\n print >> self.stderr, import_error\n return\n rec_time_filename = self.config.record_timings_filename\n try:\n workbook = xlrd.open_workbook(filename=rec_time_filename,\n formatting_info=True)\n except:\n workbook = None\n summary = {}\n if workbook:\n summary = self.read_timings_sheet(workbook)\n if len(summary[\"date\"]) > 100:\n # Need to rotate the file\n # 1) make a summary and save this\n self.report_timings_summary(summary, rec_time_filename)\n # 2) archive the file\n from zipfile import ZipFile\n import os\n zip_filename = os.path.join(self.config.path, \"rec_time.zip\")\n archive = ZipFile(zip_filename, \"a\")\n arc_name = \"%s-%s.xls\" % (rec_time_filename[len(self.config.path):-4],\n current.request.now.date()\n )\n archive.write(rec_time_filename,arc_name)\n archive.close()\n # 3) clear the current file\n os.unlink(rec_time_filename)\n summary = {}\n if \"date\" not in summary:\n last_col = 0\n summary[\"date\"] = [current.request.now.date()]\n else:\n last_col = len(summary[\"date\"])\n summary[\"date\"].append(current.request.now.date())\n for (url, rd_obj) in self.results.items():\n if url not in summary:\n summary[url] = []\n # ensure that the row is as long as the number of dates\n shortage = last_col - len(summary[url])\n if shortage > 0:\n summary[url] = summary[url] + ['']*shortage\n summary[url].append((rd_obj.get_duration(), rd_obj.is_broken()))\n self.write_timings_sheet(summary, rec_time_filename)", "metadata": "root.BrokenLinkTest.record_timings", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 297 }, { "content": " def read_timings_sheet(self, workbook):\n \"\"\"\n This will extract all the details from the xls sheet\n \"\"\"\n sheet = workbook.sheet_by_name(\"Timings\")\n summary = {}\n RED = 0x0A\n num_cells = sheet.ncols\n summary[\"date\"] = []\n for col in range(1, num_cells):\n summary[\"date\"].append(sheet.cell_value(0, col))\n for row in range(1,sheet.nrows):\n url = sheet.cell_value(row, 0)\n summary[url] = []\n for col in range(1, num_cells):\n duration = sheet.cell_value(row, col)\n xf = sheet.cell_xf_index(row, col)\n bg = workbook.xf_list[xf].background\n broken = (bg.pattern_colour_index == RED)\n summary[url].append((duration, broken))\n return summary", "metadata": "root.BrokenLinkTest.read_timings_sheet", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 352 }, { "content": " def write_timings_sheet(self, summary, filename=None):\n import xlwt\n RED = 0x0A\n book = xlwt.Workbook(encoding=\"utf-8\")\n sheet = book.add_sheet(\"Timings\")\n stylebroken = xlwt.XFStyle()\n stylebroken.pattern.pattern = stylebroken.pattern.SOLID_PATTERN\n stylebroken.pattern.pattern_fore_colour = RED\n col = 1\n for date in summary[\"date\"]:\n sheet.write(0,col,str(date))\n col += 1\n row = 1\n for (url, results) in summary.items():\n if url == \"date\":\n continue\n sheet.write(row,0,url)\n col = 1\n for data in results:\n if len(data) == 2 and data[1]:\n sheet.write(row,col,data[0],stylebroken)\n elif len(data) > 0:\n sheet.write(row,col,data[0])\n col += 1\n row += 1\n if filename:\n book.save(filename)\n return book", "metadata": "root.BrokenLinkTest.write_timings_sheet", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 374 }, { "content": " def report_timings_summary(self,\n summary,\n summary_file_name = None,\n mean_threshold = 1):\n \"\"\"\n This will extract the details from the sheet and optionally save\n them to a summary file\n\n summary: the summary details returned from the spreadsheet (read_timings_sheet)\n summary_file_name: name of the file to record the summary details (if required)\n mean_threshold: The minimum number of values required to include\n the mean in the regression calculations\n \"\"\"\n import numpy\n import datetime\n good_values = []\n other_values = []\n total_values = []\n for date in summary[\"date\"]:\n good_values.append([])\n other_values.append([])\n total_values.append([])\n for (url,results) in summary.items():\n if url == \"date\":\n continue\n else:\n cnt = 0\n for (duration, broken) in results:\n if duration != \"\":\n total_values[cnt].append(duration)\n if broken:\n other_values[cnt].append(duration)\n else:\n good_values[cnt].append(duration)\n cnt += 1\n # get the number of days each entry is after the first date\n # and calculate the average, if the average is NAN then ignore both\n date_summary = []\n gv_mean = []\n gv_std = []\n gv_date = []\n cnt = 0\n start = datetime.datetime.strptime(summary[\"date\"][0],\"%Y-%m-%d\")\n for list in good_values:\n if len(list) > mean_threshold:\n mean = numpy.mean(list)\n std = numpy.std(list)\n if not numpy.isnan(mean):\n this_date = datetime.datetime.strptime(summary[\"date\"][cnt],\"%Y-%m-%d\")\n date_summary.append((this_date - start).days)\n gv_mean.append(mean)\n gv_std.append(std)\n gv_date.append(summary[\"date\"][cnt])\n cnt += 1\n # calculate the regression line\n if len(gv_mean) > 2:\n (m,b) = numpy.polyfit(date_summary, gv_mean, 1)\n else:\n m = b = 0\n\n if summary_file_name != None:\n book = self.write_timings_sheet(summary)\n sheet = book.add_sheet(\"summary\")\n row = 0\n for date in gv_date:\n sheet.write(row,0,str(date))\n sheet.write(row,1,gv_mean[row])\n row += 1\n sheet.write(row,0,\"Trend\")\n sheet.write(row,1,m)\n # Save the details to the summary file\n book.save(summary_file_name)\n return (date_summary, gv_mean, gv_std, m, b)", "metadata": "root.BrokenLinkTest.report_timings_summary", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 403 }, { "content": " def report_model_url(self):\n print \"Report breakdown by module\"\n for (model, value) in self.model_url.items():\n print model\n for ud in value:\n url = ud[0]\n depth = ud[1]\n parent = ud[2]\n tabs = \"\\t\" * depth\n print \"%s %s-%s (parent url - %s)\" % (tabs, depth, url, parent)", "metadata": "root.BrokenLinkTest.report_model_url", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 477 }, { "content": " def brokenReport(self):\n self.reporter(\"Broken Links\")\n as_html = current.test_config.html\n self.broken_links_count = 0\n for (url, rd_obj) in self.results.items():\n if as_html:\n print_url = \"<a href=%s%s target=\\\"_blank\\\">%s</a>\" % (self.homeURL, url, url)\n else:\n print_url = url\n if rd_obj.is_broken():\n if rd_obj.threw_exception():\n msg = \"(Exception) %s\" % print_url\n else:\n http_code = rd_obj.return_http_code()\n ticket = rd_obj.the_ticket(as_html)\n try:\n parent = self.urlParentList[url]\n if as_html:\n parent = \"<a href=%s%s target=\\\"_blank\\\">Parent</a>\" % (self.homeURL, parent)\n except:\n parent = \"unknown\"\n msg = \"%3d. (%s - %s) %s called from %s\" % (self.broken_links_count + 1,\n http_code,\n ticket,\n print_url,\n parent\n )\n self.reporter(msg)\n self.broken_links_count += 1", "metadata": "root.BrokenLinkTest.brokenReport", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 488 }, { "content": " def timeReport(self):\n from operator import itemgetter\n import numpy\n thresholdLink = {}\n linktimes = []\n for (url, rd_obj) in self.results.items():\n duration = rd_obj.get_duration()\n linktimes.append(duration)\n if duration > self.threshold:\n thresholdLink[url] = duration\n self.reporter(\"Time Analysis - Links beyond threshold\")\n for (visited_url, duration) in sorted(thresholdLink.iteritems(),\n key=itemgetter(1),\n reverse=True):\n self.reporter( \"%s took %.3f seconds\" % (visited_url, duration))\n\n self.reporter(\"Time Analysis - summary\")\n total = len(linktimes)\n average = numpy.mean(linktimes)\n std = numpy.std(linktimes)\n msg = \"%s links visited with an average time of %.3f and standard deviation of %.3f\" % (total, average, std)\n self.reporter(msg)", "metadata": "root.BrokenLinkTest.timeReport", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 518 }, { "content": " def scatterplot(self):\n \"\"\"\n Method to draw a scatterplot of the average time to download links\n against time. Add a regression line to show the trend over time.\n \"\"\"\n try:\n from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas\n self.FigureCanvas = FigureCanvas\n from matplotlib.figure import Figure\n self.Figure = Figure\n import numpy\n except ImportError:\n return\n try:\n import xlrd\n except:\n import_error += \"ERROR: the xlrd modules is needed to record timings\\n\"\n rec_time_filename = self.config.record_timings_filename\n try:\n workbook = xlrd.open_workbook(filename=rec_time_filename,\n formatting_info=True)\n except:\n return\n import numpy\n # Only include the mean in the regression values if there are at least 10 URL timings\n summary = self.read_timings_sheet(workbook)\n (date_summary, gv_mean, gv_std, m, b) = self.report_timings_summary(summary, mean_threshold=10)\n if len(gv_mean) <= 2:\n return\n fig = Figure(figsize=(5, 2.5))\n canvas = self.FigureCanvas(fig)\n ax = fig.add_subplot(111)\n linear = numpy.poly1d([m,b])\n denom = numpy.max(gv_std)/50\n size = gv_std/denom\n ax.scatter(date_summary, gv_mean, marker=\"d\", s=size)\n ax.plot(date_summary, linear(date_summary), '--r')\n\n chart = StringIO()\n canvas.print_figure(chart)\n image = chart.getvalue()\n import base64\n base64Img = base64.b64encode(image)\n image = \"<img src=\\\"data:image/png;base64,%s\\\">\" % base64Img\n self.reporter(\"Scatterplot of average link times per successful run\")\n self.reporter(image)\n self.reporter(\"The trend line has a current slope of %s\" % m)\n self.reporter(\"The y-intercept is %s seconds\" % b)", "metadata": "root.BrokenLinkTest.scatterplot", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 541 }, { "content": " def depthReport(self):\n \"\"\"\n Method to draw a histogram of the number of new links\n discovered at each depth.\n (i.e. show how many links are required to reach a link)\n \"\"\"\n try:\n from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas\n self.FigureCanvas = FigureCanvas\n from matplotlib.figure import Figure\n self.Figure = Figure\n from numpy import arange\n except ImportError:\n return\n self.reporter(\"Analysis of link depth\")\n fig = Figure(figsize=(4, 2.5))\n # Draw a histogram\n width = 0.9\n rect = [0.12, 0.08, 0.9, 0.85]\n ax = fig.add_axes(rect)\n left = arange(len(self.linkDepth))\n plot = ax.bar(left, self.linkDepth, width=width)\n # Add the x axis labels\n ax.set_xticks(left+(width*0.5))\n ax.set_xticklabels(left)\n\n chart = StringIO()\n canvas = self.FigureCanvas(fig)\n canvas.print_figure(chart)\n image = chart.getvalue()\n import base64\n base64Img = base64.b64encode(image)\n image = \"<img src=\\\"data:image/png;base64,%s\\\">\" % base64Img\n self.reporter(image)", "metadata": "root.BrokenLinkTest.depthReport", "header": "['class', 'BrokenLinkTest', '(', 'Web2UnitTest', ')', ':', '___EOS___']", "index": 590 }, { "content": "class ReportData():\n \"\"\"\n Class to hold the data collected from the smoke test ready for reporting\n Instances of this class will be held in the dictionary results which will\n be keyed on the url. This way, in an attempt to minimise the memory used,\n the url doesn't need to be stored in this class.\n\n The class will have the following properties\n broken: boolean\n exception: boolean\n http_code: integer\n ticket: URL of any ticket linked with this url\n parent: the parent URL of this url\n depth: how deep is this url\n duration: how long did it take to get the url\n \"\"\"\n\n\n\n\n\n", "metadata": "root.ReportData", "header": "['module', '___EOS___']", "index": 625 }, { "content": " def is_broken(self):\n if hasattr(self, \"broken\"):\n return self.broken\n return False", "metadata": "root.ReportData.is_broken", "header": "['class', 'ReportData', '(', ')', ':', '___EOS___']", "index": 641 }, { "content": " def threw_exception(self):\n if hasattr(self, \"exception\"):\n return self.exception\n return False", "metadata": "root.ReportData.threw_exception", "header": "['class', 'ReportData', '(', ')', ':', '___EOS___']", "index": 646 }, { "content": " def return_http_code(self):\n if hasattr(self, \"http_code\"):\n return self.http_code\n return \"-\"", "metadata": "root.ReportData.return_http_code", "header": "['class', 'ReportData', '(', ')', ':', '___EOS___']", "index": 651 }, { "content": " def the_ticket(self, html):\n \"\"\"\n Should only have a ticket if it is broken,\n but won't always have a ticket to display.\n \"\"\"\n if hasattr(self, \"ticket\"):\n if html:\n return \"<a href=%s target=\\\"_blank\\\">Ticket</a>\" % (self.ticket)\n else:\n return \"Ticket: %s\" % (self.ticket)\n return \"no ticket\"", "metadata": "root.ReportData.the_ticket", "header": "['class', 'ReportData', '(', ')', ':', '___EOS___']", "index": 656 }, { "content": " def get_parent(self):\n if hasattr(self, \"parent\"):\n return self.parent\n return \"\"", "metadata": "root.ReportData.get_parent", "header": "['class', 'ReportData', '(', ')', ':', '___EOS___']", "index": 668 }, { "content": " def get_depth(self):\n if hasattr(self, \"depth\"):\n return self.depth\n return 0", "metadata": "root.ReportData.get_depth", "header": "['class', 'ReportData', '(', ')', ':', '___EOS___']", "index": 673 }, { "content": " def get_duration(self):\n if hasattr(self, \"duration\"):\n return self.duration\n return 0", "metadata": "root.ReportData.get_duration", "header": "['class', 'ReportData', '(', ')', ':', '___EOS___']", "index": 678 } ]
[ { "span": "import sys", "start_line": 32, "start_column": 0, "end_line": 32, "end_column": 10 }, { "span": "import socket", "start_line": 33, "start_column": 0, "end_line": 33, "end_column": 13 }, { "span": "import mechanize", "start_line": 44, "start_column": 4, "end_line": 44, "end_column": 20 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", " ", "Sa", "han", "a", " ", "Ed", "en", " ", "Test", " ", "Frame", "work", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "@", "copyr", "ight", ":", " ", "2011", "-", "2016", " ", "(", "c", ")", " ", "Sa", "han", "a", " ", "Sof", "twa", "re", " ", "Foun", "dati", "on", "\\", "10", ";", " ", " ", " ", " ", "@", "license", ":", " ", "MIT", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Permi", "ssion", " ", "is", " ", "here", "by", " ", "grant", "ed", ",", " ", "free", " ", "of", " ", "charge", ",", " ", "to", " ", "any", " ", "person", "\\", "10", ";", " ", " ", " ", " ", "obtain", "ing", " ", "a", " ", "copy", " ", "of", " ", "this", " ", "software", " ", "and", " ", "associate", "d", " ", "documentation", "\\", "10", ";", " ", " ", " ", " ", "files", " ", "(", "the", " ", "\"", "Sof", "twa", "re", "\")", ",", " ", "to", " ", "deal", " ", "in", " ", "the", " ", "Sof", "twa", "re", " ", "with", "out", "\\", "10", ";", " ", " ", " ", " ", "restriction", ",", " ", "inclu", "ding", " ", "with", "out", " ", "limit", "ation", " ", "the", " ", "rights", " ", "to", " ", "use", ",", "\\", "10", ";", " ", " ", " ", " ", "copy", ",", " ", "modif", "y", ",", " ", "merge", ",", " ", "publi", "sh", ",", " ", "distribute", ",", " ", "subli", "cens", "e", ",", " ", "and", "/", "or", " ", "sell", "\\", "10", ";", " ", " ", " ", " ", "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", "\\", "10", ";", " ", " ", " ", " ", "condition", "s", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "above", " ", "copyr", "ight", " ", "notice", " ", "and", " ", "this", " ", "permissi", "on", " ", "notice", " ", "sha", "ll", " ", "be", "\\", "10", ";", " ", " ", " ", " ", "include", "d", " ", "in", " ", "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", ",", "\\", "10", ";", " ", " ", " ", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", ",", " ", "INC", "LU", "DING", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", " ", "THE", " ", "WAR", "RAN", "TIES", "\\", "10", ";", " ", " ", " ", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", ",", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "AND", "\\", "10", ";", " ", " ", " ", " ", "NON", "INF", "RING", "EME", "NT", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "AUTHOR", "S", " ", "OR", " ", "COPY", "RIG", "HT", "\\", "10", ";", " ", " ", " ", " ", "HOLD", "ERS", " ", "BE", " ", "LI", "AB", "LE", " ", "FOR", " ", "ANY", " ", "CLA", "IM", ",", " ", "DA", "MAGE", "S", " ", "OR", " ", "OTHER", " ", "LI", "ABI", "LIT", "Y", ",", "\\", "10", ";", " ", " ", " ", " ", "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", "\\", "10", ";", " ", " ", " ", " ", "OTHER", " ", "DEA", "LING", "S", " ", "IN", " ", "THE", " ", "SOFT", "WARE", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "time_", "import_", "time_", "\\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_", "#", " ", "Fast", "er", ",", " ", "where", " ", "available_", "\\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_", "import_", "sys_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "socket_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "tests_", "._", "web", "2u", "nit", "test_", "import_", "Web", "2", "Unit", "Test_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "gluon_", "import_", "current_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "twi", "ll_", "import_", "get", "\\u", "browser_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "twi", "ll_", "import_", "set\\u", "output_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "twi", "ll_", "._", "browser_", "import_", "*_", "\\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 ", " _", "raise_", "Name", "Error_", "(_", "\"", "Twi", "ll", " ", "not", " ", "install", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "mechani", "ze_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", "from", " ", "mechani", "ze", " ", "import", " ", "Brows", "er", "State", "Error_", "\\u\\u\\uNL\\u\\u\\u_", "#", "from", " ", "mechani", "ze", " ", "import", " ", "Control", "Not", "Foun", "d", "Error_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "except_", "Import", "Error_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "raise_", "Name", "Error_", "(_", "\"", "Mechani", "ze", " ", "not", " ", "install", "ed", "\"_", ")_", "\\u\\u\\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_", "\\u\\u\\uDEDENT\\u\\u\\u_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", " ", "Smo", "ke", " ", "Test", ",", " ", "visit", " ", "every", " ", "link", " ", "it", " ", "can", " ", "find", " ", "and", " ", "report", " ", "on", " ", "the", " ", "outco", "me", " ", "\"\"\"_", "\\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_", "#", " ", " ", " ", " ", "socket", ".", "setdefault", "timeo", "ut", "(", "value", "*", "2", ")_", "\\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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\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_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\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 ", " _", "Web", "2", "Unit", "Test_", "._", "\\u\\u", "init\\u\\u_", "(_", "self_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "b_", "=_", "get", "\\u", "browser_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "b", "\\u", "data_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "set\\u", "output_", "(_", "self_", "._", "b", "\\u", "data_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "clear", "Record_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Thi", "s", " ", "string", " ", "must", " ", "exist", " ", "in", " ", "the", " ", "URL", " ", "for", " ", "it", " ", "to", " ", "be", " ", "followe", "d_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "efu", "l", " ", "to", " ", "avoid", " ", "goi", "ng", " ", "to", " ", "linked", " ", "sites_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "home", "URL_", "=_", "self_", "._", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Link", " ", "used", " ", "to", " ", "identify", " ", "a", " ", "URL", " ", "to", " ", "a", " ", "ticket_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url", "\\u", "ticket_", "=_", "\"/", "admin", "/", "default", "/", "tick", "et", "/\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Tup", "le", " ", "of", " ", "string", "s", " ", "tha", "t", " ", "if", " ", "in", " ", "the", " ", "URL", " ", "will", " ", "be", " ", "ignored_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Us", "efu", "l", " ", "to", " ", "avoid", " ", "dynami", "c", " ", "URL", "s", " ", "tha", "t", " ", "trigger", " ", "the", " ", "same", " ", "functional", "ity_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "include", "\\u", "ignore_", "=_", "(_", "\"\\u", "language", "=\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "logo", "ut", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "appa", "dmin", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "admin", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "\"", "delete", "\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "tuple", " ", "of", " ", "string", "s", " ", "tha", "t", " ", "shou", "ld", " ", "be", " ", "remove", "d", " ", "from", " ", "the", " ", "URL", " ", "bef", "ore", " ", "stor", "ing_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "Typical", "ly", " ", "this", " ", "will", " ", "be", " ", "some", " ", "variab", "les", " ", "pass", "ed", " ", "in", " ", "via", " ", "the", " ", "URL_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "strip", "\\u", "url_", "=_", "(_", "\"?", "\\u", "next", "=\"_", ",_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "report", "Only_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "max", "Depth_", "=_", "16_", "#", " ", "sanity", " ", "check_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "Threshold_", "(_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "set", "User_", "(_", "\"", "test", "@", "example", ".", "com", "/", "eden", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "total", "\\u", "visited_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "broken", "\\u", "link", "s", "\\u", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "clear", "Record_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "the", " ", "total", " ", "url", " ", "link", "s", " ", "visited_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "total", "Links_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "The", " ", "number", " ", "of", " ", "unique", " ", "urls", " ", "found", " ", "at", " ", "depth", " ", "i", ",", " ", "where", " ", "i", " ", "is", " ", "the", " ", "index_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "link", "Depth_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Dict", "ionar", "y", " ", "of", " ", "the", " ", "parent", " ", "for", " ", "each", " ", "URL_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "url", "Parent", "List_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "dictionar", "y", " ", "of", " ", "Report", "Data", " ", "object", "s", " ", "indexe", "d", " ", "on", " ", "the", " ", "url_", "\\u\\u\\uNL\\u\\u\\u_", "self_", "._", "results_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Report", "Only_", "(_", "self_", ",_", "action_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "report", "Only_", "=_", "action_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Depth_", "(_", "self_", ",_", "depth_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "max", "Depth_", "=_", "depth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "User_", "(_", "self_", ",_", "user_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "credentials_", "=_", "user_", "._", "split_", "(_", "\",\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "set", "Threshold_", "(_", "self_", ",_", "value_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "value_", "=_", "float_", "(_", "value_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "threshold_", "=_", "value_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "login_", "(_", "self_", ",_", "credentials_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "credentials_", "==_", "\"", "UNA", "UTH", "ENTI", "CATE", "D", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "\"%", "s", "/", "default", "/", "user", "/", "logo", "ut", "\"_", "%_", "self_", "._", "home", "URL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "b_", "._", "go_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "True_", "\\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_", "._", "user_", ",_", "self_", "._", "password_", ")_", "=_", "credentials_", "._", "split_", "(_", "\"/\"_", ",_", "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 ", " _", "msg_", "=_", "\"", "Una", "ble", " ", "to", " ", "split", " ", "%", "s", " ", "int", "o", " ", "a", " ", "user", " ", "name", " ", "and", " ", "password", "\"_", "%_", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reporter_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "url_", "=_", "\"%", "s", "/", "default", "/", "user", "/", "login", "\"_", "%_", "self_", "._", "home", "URL_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "b_", "._", "go_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "forms_", "=_", "self_", "._", "b_", "._", "get", "\\u", "all", "\\u", "forms_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "form_", "in_", "forms_", ":_", "\\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 ", " _", "if_", "form_", "[_", "\"\\u", "form", "name", "\"_", "]_", "==_", "\"", "login", "\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "b_", "._", "\\u", "browser_", "._", "form_", "=_", "form_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "[_", "\"", "email", "\"_", "]_", "=_", "self_", "._", "user_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "form_", "[_", "\"", "password", "\"_", "]_", "=_", "self_", "._", "password_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "b_", "._", "submit_", "(_", "\"", "Logi", "n", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "If", " ", "login", " ", "is", " ", "success", "ful", " ", "then", " ", "shou", "ld", " ", "be", " ", "redirected", " ", "to", " ", "the", " ", "homepage_", "\\u\\u\\uNL\\u\\u\\u_", "return_", "self_", "._", "b_", "._", "get", "\\u", "url_", "(_", ")_", "[_", "len_", "(_", "self_", "._", "home", "URL_", ")_", ":_", "]_", "==_", "\"/", "default", "/", "index", "\"_", "\\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_", "#", " ", "Thi", "s", " ", "shou", "ld", " ", "be", " ", "a", " ", "mechani", "ze", ".", "Control", "Not", "Foun", "d", "Error", ",", " ", "but", "_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "for", " ", "some", " ", "unknown", " ", "reason", " ", "tha", "t", " ", "isn", "'", "t", " ", "cau", "ght", " ", "on", " ", "Window", "s", " ", "or", " ", "Mac", "_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "pass_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "add", "Result", "s2", "Current_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "'''", "\\", "10", ";", " ", " ", " ", " ", "Stor", "e", " ", "the", " ", "count", " ", "link", "s", " ", "in", " ", "glu", "on", ".", "current", " ", "to", " ", "be", " ", "used", " ", "by", " ", "HTM", "LT", "est", "Run", "ner", " ", "for", " ", "bett", "er", " ", "reporting", "\\", "10", ";", " ", " ", " ", " ", "'''_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "smoke", "\\u", "results_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "smoke", "\\u", "results_", "[_", "'", "working", "\\u", "link", "s", "'_", "]_", "=_", "self_", "._", "total", "\\u", "visited_", "-_", "self_", "._", "broken", "\\u", "link", "s", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "smoke", "\\u", "results_", "[_", "'", "broken", "\\u", "link", "s", "\\u", "count", "'_", "]_", "=_", "self_", "._", "broken", "\\u", "link", "s", "\\u", "count_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current_", "._", "data_", "[_", "'", "smoke", "\\u", "results", "'_", "]_", "=_", "smoke", "\\u", "results_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "run", "Test_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Test", " ", "to", " ", "find", " ", "all", " ", "exposed", " ", "link", "s", " ", "and", " ", "check", " ", "the", " ", "http", " ", "code", " ", "return", "ed", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "test", " ", "doe", "sn", "'", "t", " ", "run", " ", "any", " ", "javascript", " ", "so", " ", "some", " ", "fal", "se", " ", "positives", "\\", "10", ";", " ", " ", " ", " ", "will", " ", "be", " ", "found", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "test", " ", "can", " ", "als", "o", " ", "display", " ", "an", " ", "histo", "gram", " ", "dep", "ict", "ing", " ", "the", " ", "number", " ", "of", "\\", "10", ";", " ", " ", " ", " ", "link", "s", " ", "found", " ", "at", " ", "each", " ", "depth", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Fail", "ure", " ", "or", " ", "Success", " ", "to", " ", "be", " ", "shown", " ", "in", " ", "the", " ", "report", " ", "is", " ", "checke", "d", " ", "in", " ", "add", "Success", " ", "in", " ", "Test", "Result", "\\", "10", ";", " ", " ", " ", " ", "class", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "user_", "in_", "self_", "._", "credentials_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "clear", "Record_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "login_", "(_", "user_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "reporter_", "(_", "\"", "Smo", "ke", " ", "Test", " ", "for", " ", "user", " ", "%", "s", "\"_", "%_", "self_", "._", "user_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "visit", "Links_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "report_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "add", "Result", "s2", "Current_", "(_", ")_", "\\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_", "Exception_", "(_", "\"", "Logi", "n", " ", "Fail", "ed", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit", "Links_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "self_", "._", "home", "URL_", "+_", "\"/", "default", "/", "index", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "to", "\\u", "visit_", "=_", "[_", "url_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "total", "\\u", "visited_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "self_", "._", "report", "Only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "depth_", "in_", "range_", "(_", "self_", "._", "max", "Depth_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "to", "\\u", "visit_", ")_", "==_", "0_", ":_", "\\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_", "self_", "._", "link", "Depth_", "._", "append_", "(_", "len_", "(_", "to", "\\u", "visit_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "total", "Links_", "+=_", "len_", "(_", "to", "\\u", "visit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "visit", "\\u", "start_", "=_", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "url", "\\u", "visited_", "=_", "\"%", "d", " ", "urls", "\"_", "%_", "len_", "(_", "to", "\\u", "visit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "total", "\\u", "visited_", "+=_", "len_", "(_", "to", "\\u", "visit_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "to", "\\u", "visit_", "=_", "self_", "._", "visit_", "(_", "to", "\\u", "visit_", ",_", "depth_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "\"%", ".2", "d", " ", "Visit", "ed", " ", "%", "s", " ", "in", " ", "%", ".3", "f", " ", "second", "s", ",", " ", "%", "d", " ", "more", " ", "urls", " ", "found", "\"_", "%_", "(_", "depth_", ",_", "url", "\\u", "visited_", ",_", "time_", "(_", ")_", "-_", "visit", "\\u", "start_", ",_", "len_", "(_", "to", "\\u", "visit_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reporter_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "verbose_", ">=_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "self_", "._", "config_", "._", "verbose_", ">=_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", ">>_", "self_", "._", "stdout_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "self_", "._", "stdout_", "._", "isatty_", "(_", ")_", ":_", "#", " ", "termina", "l", " ", "shou", "ld", " ", "support", " ", "colour_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "msg_", "=_", "\"%", ".2", "d", " ", "Visit", "ed", " ", "\\\\", "033", "[", "1", ";", "32", "m", "%", "s", "\\\\", "033", "[", "0", "m", " ", "in", " ", "%", ".3", "f", " ", "second", "s", ",", " ", "\\\\", "033", "[", "1", ";", "3", "1", "m", "%", "d", "\\\\", "033", "[", "0", "m", " ", "more", " ", "urls", " ", "found", "\"_", "%_", "(_", "depth_", ",_", "url", "\\u", "visited_", ",_", "time_", "(_", ")_", "-_", "visit", "\\u", "start_", ",_", "len_", "(_", "to", "\\u", "visit_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "print_", ">>_", "self_", "._", "stdout_", ",_", "msg_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "to", "\\u", "visit_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "link", "Depth_", "._", "append_", "(_", "len_", "(_", "to", "\\u", "visit_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "finish_", "=_", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reporter_", "(_", "\"", "Finish", "ed", " ", "too", "k", " ", "%", ".3", "f", " ", "second", "s", "\"_", "%_", "(_", "finish_", "-_", "start_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "visit_", "(_", "self_", ",_", "url", "\\u", "list_", ",_", "depth_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "repr", "\\u", "list_", "=_", "[_", "\".", "pdf", "\"_", ",_", "\".", "xls", "\"_", ",_", "\".", "rs", "s", "\"_", ",_", "\".", "kml", "\"_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "to", "\\u", "visit_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "record", "\\u", "data_", "=_", "self_", "._", "config_", "._", "verbose_", ">_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "visit", "ed", "\\u", "url_", "in_", "url", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "index", "\\u", "url_", "=_", "visit", "ed", "\\u", "url_", "[_", "len_", "(_", "self_", "._", "home", "URL_", ")_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "record", "\\u", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "index", "\\u", "url_", "in_", "self_", "._", "results_", "._", "keys_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "print_", ">>_", "self_", "._", "stdout_", ",_", "\"", "Warn", "ing", " ", "duplicated", " ", "url", ":", " ", "%", "s", "\"_", "%_", "index", "\\u", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "results_", "[_", "index", "\\u", "url_", "]_", "=_", "Report", "Data_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "results_", "=_", "self_", "._", "results_", "[_", "index", "\\u", "url_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "results_", "._", "depth_", "=_", "depth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Fin", "d", " ", "out", " ", "if", " ", "the", " ", "page", " ", "can", " ", "be", " ", "visited_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "open", "\\u", "nov", "isi", "t_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "repr_", "in_", "repr", "\\u", "list_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "repr_", "in_", "index", "\\u", "url_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "open", "\\u", "nov", "isi", "t_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "open", "\\u", "nov", "isi", "t_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "action_", "=_", "\"", "open", "\\u", "nov", "isi", "t", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "else_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "action_", "=_", "\"", "open", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "visit", "\\u", "start_", "=_", "time_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "b_", "._", "\\u", "journ", "ey_", "(_", "action_", ",_", "visit", "ed", "\\u", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "http", "\\u", "code_", "=_", "self_", "._", "b_", "._", "get", "\\u", "code_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "duration_", "=_", "time_", "(_", ")_", "-_", "visit", "\\u", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "record", "\\u", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "current", "\\u", "results_", "._", "duration_", "=_", "duration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "duration_", ">_", "self_", "._", "threshold_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "self_", "._", "config_", "._", "verbose_", ">=_", "3_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "print_", ">>_", "self_", "._", "stdout_", ",_", "\"%", "s", " ", "too", "k", " ", "%", ".3", "f", " ", "second", "s", "\"_", "%_", "(_", "visit", "ed", "\\u", "url_", ",_", "duration_", ")_", "\\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_", "Exception_", "as_", "e_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "duration_", "=_", "time_", "(_", ")_", "-_", "visit", "\\u", "start_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "record", "\\u", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "current", "\\u", "results_", "._", "broken", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "results_", "._", "exception_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "results_", "._", "duration_", "=_", "duration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "http", "\\u", "code_", "=_", "self_", "._", "b_", "._", "get", "\\u", "code_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "http", "\\u", "code_", "!=_", "200_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "record", "\\u", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "current", "\\u", "results_", "._", "broken", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "results_", "._", "http", "\\u", "code_", "=_", "http", "\\u", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "open", "\\u", "nov", "isi", "t_", ":_", "\\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_", "links_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "self_", "._", "b_", "._", "\\u", "browser_", "._", "viewin", "g", "\\u", "html_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "links_", "=_", "self_", "._", "b_", "._", "\\u", "browser_", "._", "links_", "(_", ")_", "\\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 ", " ", "_", "continue_", "\\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 ", " _", "import_", "traceback_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "traceback_", "._", "format\\u", "exc_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "record", "\\u", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "current", "\\u", "results_", "._", "broken", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "results_", "._", "exception_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "link_", "in_", "(_", "links_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "link_", "._", "abs", "olute", "\\u", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "url_", "._", "find_", "(_", "self_", "._", "url", "\\u", "ticket_", ")_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "A", " ", "tick", "et", " ", "was", " ", "raise", "d", " ", "so", "..._", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "captur", "e", " ", "the", " ", "deta", "il", "s", " ", "and", " ", "add", " ", "to", " ", "broken", "Links_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "record", "\\u", "data_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "current", "\\u", "results_", "._", "broken", "_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "current", "\\u", "results_", "._", "ticket_", "=_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "break_", "#", " ", "no", " ", "need", " ", "to", " ", "check", " ", "any", " ", "other", " ", "link", "s", " ", "on", " ", "this", " ", "page_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "url_", "._", "find_", "(_", "self_", "._", "home", "URL_", ")_", "==_", "-_", "1_", ":_", "\\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_", "ignore", "\\u", "link_", "=_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ignore_", "in_", "self_", "._", "include", "\\u", "ignore_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "if_", "url_", "._", "find_", "(_", "ignore_", ")_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "ignore", "\\u", "link_", "=_", "True_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "break_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "ignore", "\\u", "link_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "continue_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "strip_", "in_", "self_", "._", "strip", "\\u", "url_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "location_", "=_", "url_", "._", "find_", "(_", "strip_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "location_", "!=_", "-_", "1_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "url_", "=_", "url_", "[_", "0_", ":_", "location_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "short", "\\u", "url_", "=_", "url_", "[_", "len_", "(_", "self_", "._", "home", "URL_", ")_", ":_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "url_", "not_", "in_", "url", "\\u", "list_", "and_", "short", "\\u", "url_", "!=_", "\"\"_", "and_", "short", "\\u", "url_", "not_", "in_", "self_", "._", "results_", "._", "keys_", "(_", ")_", "and_", "url_", "not_", "in_", "to", "\\u", "visit_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "self_", "._", "url", "Parent", "List_", "[_", "short", "\\u", "url_", "]_", "=_", "index", "\\u", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "to", "\\u", "visit_", "._", "append_", "(_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "to", "\\u", "visit_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "report_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "reporter_", "(_", "\"%", "d", " ", "URL", "s", " ", "visit", "ed", "\"_", "%_", "self_", "._", "total", "Links_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "broken", "Report_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "time", "Report_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "self_", "._", "config_", "._", "record", "\\u", "timings", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "not_", "self_", "._", "report", "Only_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "record", "\\u", "timings", "_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "scatter", "plot_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "depth", "Report_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "record", "\\u", "timings", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import", "\\u", "error_", "=_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "xlr", "d_", "\\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 ", " _", "import", "\\u", "error_", "+=_", "\"", "ERROR", ":", " ", "the", " ", "xlr", "d", " ", "module", "s", " ", "is", " ", "need", "ed", " ", "to", " ", "record", " ", "timings", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "xl", "wt_", "\\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 ", " _", "import", "\\u", "error_", "+=_", "\"", "ERROR", ":", " ", "the", " ", "xl", "wt", " ", "module", "s", " ", "is", " ", "need", "ed", " ", "to", " ", "record", " ", "timings", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "import", "\\u", "error_", "!=_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", ">>_", "self_", "._", "stderr_", ",_", "import", "\\u", "error_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rec", "\\u", "time", "\\u", "filename_", "=_", "self_", "._", "config_", "._", "record", "\\u", "timings", "\\u", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "workbook_", "=_", "xlr", "d_", "._", "open", "\\u", "workbook_", "(_", "filename_", "=_", "rec", "\\u", "time", "\\u", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "format", "ting", "\\u", "info_", "=_", "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 ", " _", "workbook_", "=_", "None_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "summary_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "workbook_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "summary_", "=_", "self_", "._", "read", "\\u", "timings", "\\u", "sheet_", "(_", "workbook_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "summary_", "[_", "\"", "date", "\"_", "]_", ")_", ">_", "100_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Ne", "ed", " ", "to", " ", "rota", "te", " ", "the", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "1", ")", " ", "make", " ", "a", " ", "summar", "y", " ", "and", " ", "save", " ", "this_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "report", "\\u", "timings", "\\u", "summary_", "(_", "summary_", ",_", "rec", "\\u", "time", "\\u", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "2", ")", " ", "archive", " ", "the", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "zipfile_", "import_", "Zip", "File_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "os_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "zip", "\\u", "filename_", "=_", "os_", "._", "path_", "._", "join_", "(_", "self_", "._", "config_", "._", "path_", ",_", "\"", "rec", "\\u", "time", ".", "zip", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "archive_", "=_", "Zip", "File_", "(_", "zip", "\\u", "filename_", ",_", "\"", "a", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "arc", "\\u", "name_", "=_", "\"%", "s", "-%", "s", ".", "xls", "\"_", "%_", "(_", "rec", "\\u", "time", "\\u", "filename_", "[_", "len_", "(_", "self_", "._", "config_", "._", "path_", ")_", ":_", "-_", "4_", "]_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "current_", "._", "request_", "._", "now_", "._", "date_", "(_", ")_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "archive_", "._", "write_", "(_", "rec", "\\u", "time", "\\u", "filename_", ",_", "arc", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "archive_", "._", "close_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "3", ")", " ", "clear", " ", "the", " ", "current", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "os_", "._", "unlink_", "(_", "rec", "\\u", "time", "\\u", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "summary_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "\"", "date", "\"_", "not_", "in_", "summary_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "last", "\\u", "col_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "summary_", "[_", "\"", "date", "\"_", "]_", "=_", "[_", "current_", "._", "request_", "._", "now_", "._", "date_", "(_", ")_", "]_", "\\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 ", " _", "last", "\\u", "col_", "=_", "len_", "(_", "summary_", "[_", "\"", "date", "\"_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "summary_", "[_", "\"", "date", "\"_", "]_", "._", "append_", "(_", "current_", "._", "request_", "._", "now_", "._", "date_", "(_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "(_", "url_", ",_", "rd", "\\u", "obj_", ")_", "in_", "self_", "._", "results_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "url_", "not_", "in_", "summary_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "summary_", "[_", "url_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "ensure", " ", "tha", "t", " ", "the", " ", "row", " ", "is", " ", "as", " ", "long", " ", "as", " ", "the", " ", "number", " ", "of", " ", "dates_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "short", "age_", "=_", "last", "\\u", "col_", "-_", "len_", "(_", "summary_", "[_", "url_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "short", "age_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "summary_", "[_", "url_", "]_", "=_", "summary_", "[_", "url_", "]_", "+_", "[_", "''_", "]_", "*_", "short", "age_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "summary_", "[_", "url_", "]_", "._", "append_", "(_", "(_", "rd", "\\u", "obj_", "._", "get", "\\u", "duration_", "(_", ")_", ",_", "rd", "\\u", "obj_", "._", "is", "\\u", "broken", "_", "(_", ")_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "write", "\\u", "timings", "\\u", "sheet_", "(_", "summary_", ",_", "rec", "\\u", "time", "\\u", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "read", "\\u", "timings", "\\u", "sheet_", "(_", "self_", ",_", "workbook_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "will", " ", "extract", " ", "all", " ", "the", " ", "deta", "il", "s", " ", "from", " ", "the", " ", "xls", " ", "sheet", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sheet_", "=_", "workbook_", "._", "sheet", "\\u", "by", "\\u", "name_", "(_", "\"", "Tim", "ings", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "summary_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RED_", "=_", "0x0", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "num", "\\u", "cells_", "=_", "sheet_", "._", "ncols_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "summary_", "[_", "\"", "date", "\"_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "col_", "in_", "range_", "(_", "1_", ",_", "num", "\\u", "cells_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "summary_", "[_", "\"", "date", "\"_", "]_", "._", "append_", "(_", "sheet_", "._", "cell", "\\u", "value_", "(_", "0_", ",_", "col_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "row_", "in_", "range_", "(_", "1_", ",_", "sheet_", "._", "nrows_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "sheet_", "._", "cell", "\\u", "value_", "(_", "row_", ",_", "0_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "summary_", "[_", "url_", "]_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "col_", "in_", "range_", "(_", "1_", ",_", "num", "\\u", "cells_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "duration_", "=_", "sheet_", "._", "cell", "\\u", "value_", "(_", "row_", ",_", "col_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "xf_", "=_", "sheet_", "._", "cell", "\\u", "xf", "\\u", "index_", "(_", "row_", ",_", "col_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "bg_", "=_", "workbook_", "._", "xf", "\\u", "list_", "[_", "xf_", "]_", "._", "background_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "broken", "_", "=_", "(_", "bg_", "._", "pattern", "\\u", "colour", "\\u", "index_", "==_", "RED_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "summary_", "[_", "url_", "]_", "._", "append_", "(_", "(_", "duration_", ",_", "broken", "_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "summary_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "write", "\\u", "timings", "\\u", "sheet_", "(_", "self_", ",_", "summary_", ",_", "filename_", "=_", "None_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "xl", "wt_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "RED_", "=_", "0x0", "A_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "book_", "=_", "xl", "wt_", "._", "Workbook", "_", "(_", "encoding_", "=_", "\"", "utf", "-", "8", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sheet_", "=_", "book_", "._", "add", "\\u", "sheet_", "(_", "\"", "Tim", "ings", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "style", "broken", "_", "=_", "xl", "wt_", "._", "XF", "Style_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "style", "broken", "_", "._", "pattern_", "._", "pattern_", "=_", "style", "broken", "_", "._", "pattern_", "._", "SOL", "ID", "\\u", "PATTERN_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "style", "broken", "_", "._", "pattern_", "._", "pattern", "\\u", "fore", "\\u", "colour_", "=_", "RED_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "date_", "in_", "summary_", "[_", "\"", "date", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sheet_", "._", "write_", "(_", "0_", ",_", "col_", ",_", "str_", "(_", "date_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "row_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "url_", ",_", "results_", ")_", "in_", "summary_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "url_", "==_", "\"", "date", "\"_", ":_", "\\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_", "sheet_", "._", "write_", "(_", "row_", ",_", "0_", ",_", "url_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "col_", "=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "data_", "in_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "data_", ")_", "==_", "2_", "and_", "data_", "[_", "1_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sheet_", "._", "write_", "(_", "row_", ",_", "col_", ",_", "data_", "[_", "0_", "]_", ",_", "style", "broken", "_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "elif_", "len_", "(_", "data_", ")_", ">_", "0_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "sheet_", "._", "write_", "(_", "row_", ",_", "col_", ",_", "data_", "[_", "0_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "col_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "row_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "filename_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "book_", "._", "save_", "(_", "filename_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "book_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "report", "\\u", "timings", "\\u", "summary_", "(_", "self_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "summary_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "summar", "y", "\\u", "file", "\\u", "name_", "=_", "None_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "mean", "\\u", "threshold_", "=_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Thi", "s", " ", "will", " ", "extract", " ", "the", " ", "deta", "il", "s", " ", "from", " ", "the", " ", "sheet", " ", "and", " ", "option", "ally", " ", "save", "\\", "10", ";", " ", " ", " ", " ", "them", " ", "to", " ", "a", " ", "summar", "y", " ", "file", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "summar", "y", ":", " ", "the", " ", "summar", "y", " ", "deta", "il", "s", " ", "return", "ed", " ", "from", " ", "the", " ", "spreadsheet", " ", "(", "read", "\\u", "timings", "\\u", "sheet", ")", "\\", "10", ";", " ", " ", " ", " ", "summar", "y", "\\u", "file", "\\u", "name", ":", " ", "name", " ", "of", " ", "the", " ", "file", " ", "to", " ", "record", " ", "the", " ", "summar", "y", " ", "deta", "il", "s", " ", "(", "if", " ", "require", "d", ")", "\\", "10", ";", " ", " ", " ", " ", "mean", "\\u", "threshol", "d", ":", " ", "The", " ", "minim", "um", " ", "number", " ", "of", " ", "values", " ", "require", "d", " ", "to", " ", "include", "\\", "10", ";", " ", " ", " ", " ", " ", " ", "the", " ", "mean", " ", "in", " ", "the", " ", "regress", "ion", " ", "calculati", "ons", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "datetime_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "good", "\\u", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total", "\\u", "values_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "date_", "in_", "summary_", "[_", "\"", "date", "\"_", "]_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "good", "\\u", "values_", "._", "append_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "other", "\\u", "values_", "._", "append_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total", "\\u", "values_", "._", "append_", "(_", "[_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "(_", "url_", ",_", "results_", ")_", "in_", "summary_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "url_", "==_", "\"", "date", "\"_", ":_", "\\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 ", " _", "cnt_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "for_", "(_", "duration_", ",_", "broken", "_", ")_", "in_", "results_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "duration_", "!=_", "\"\"_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "total", "\\u", "values_", "[_", "cnt_", "]_", "._", "append_", "(_", "duration_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "broken", "_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "other", "\\u", "values_", "[_", "cnt_", "]_", "._", "append_", "(_", "duration_", ")_", "\\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 ", " ", " _", "good", "\\u", "values_", "[_", "cnt_", "]_", "._", "append_", "(_", "duration_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cnt_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "get", " ", "the", " ", "number", " ", "of", " ", "day", "s", " ", "each", " ", "entry", " ", "is", " ", "after", " ", "the", " ", "first", " ", "date_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "and", " ", "calcul", "ate", " ", "the", " ", "averag", "e", ",", " ", "if", " ", "the", " ", "averag", "e", " ", "is", " ", "NAN", " ", "then", " ", "ignore", " ", "both_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "date", "\\u", "summary_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gv", "\\u", "mean_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gv", "\\u", "std_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gv", "\\u", "date_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "cnt_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "start_", "=_", "datetime_", "._", "datetime_", "._", "strptime_", "(_", "summary_", "[_", "\"", "date", "\"_", "]_", "[_", "0_", "]_", ",_", "\"%", "Y", "-%", "m", "-%", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "list_", "in_", "good", "\\u", "values_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "len_", "(_", "list_", ")_", ">_", "mean", "\\u", "threshold_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "mean_", "=_", "numpy_", "._", "mean_", "(_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std_", "=_", "numpy_", "._", "std_", "(_", "list_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "not_", "numpy_", "._", "isnan_", "(_", "mean_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "this", "\\u", "date_", "=_", "datetime_", "._", "datetime_", "._", "strptime_", "(_", "summary_", "[_", "\"", "date", "\"_", "]_", "[_", "cnt_", "]_", ",_", "\"%", "Y", "-%", "m", "-%", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "date", "\\u", "summary_", "._", "append_", "(_", "(_", "this", "\\u", "date_", "-_", "start_", ")_", "._", "days_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gv", "\\u", "mean_", "._", "append_", "(_", "mean_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gv", "\\u", "std_", "._", "append_", "(_", "std_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "gv", "\\u", "date_", "._", "append_", "(_", "summary_", "[_", "\"", "date", "\"_", "]_", "[_", "cnt_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "cnt_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "calcul", "ate", " ", "the", " ", "regress", "ion", " ", "line_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "len_", "(_", "gv", "\\u", "mean_", ")_", ">_", "2_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "m_", ",_", "b_", ")_", "=_", "numpy_", "._", "polyf", "it_", "(_", "date", "\\u", "summary_", ",_", "gv", "\\u", "mean_", ",_", "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 ", " _", "m_", "=_", "b_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "summar", "y", "\\u", "file", "\\u", "name_", "!=_", "None_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "book_", "=_", "self_", "._", "write", "\\u", "timings", "\\u", "sheet_", "(_", "summary_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sheet_", "=_", "book_", "._", "add", "\\u", "sheet_", "(_", "\"", "summar", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "date_", "in_", "gv", "\\u", "date_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "sheet_", "._", "write_", "(_", "row_", ",_", "0_", ",_", "str_", "(_", "date_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sheet_", "._", "write_", "(_", "row_", ",_", "1_", ",_", "gv", "\\u", "mean_", "[_", "row_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "row_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "sheet_", "._", "write_", "(_", "row_", ",_", "0_", ",_", "\"", "Tren", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "sheet_", "._", "write_", "(_", "row_", ",_", "1_", ",_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Save", " ", "the", " ", "deta", "il", "s", " ", "to", " ", "the", " ", "summar", "y", " ", "file_", "\\u\\u\\uNL\\u\\u\\u_", "book_", "._", "save_", "(_", "summar", "y", "\\u", "file", "\\u", "name_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "(_", "date", "\\u", "summary_", ",_", "gv", "\\u", "mean_", ",_", "gv", "\\u", "std_", ",_", "m_", ",_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "report", "\\u", "model", "\\u", "url_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "\"", "Report", " ", "breakdown", " ", "by", " ", "module", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "model_", ",_", "value_", ")_", "in_", "self_", "._", "model", "\\u", "url_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print_", "model_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "ud_", "in_", "value_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "url_", "=_", "ud_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "depth_", "=_", "ud_", "[_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "parent_", "=_", "ud_", "[_", "2_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "tabs_", "=_", "\"\\\\", "t", "\"_", "*_", "depth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "print_", "\"%", "s", " ", "%", "s", "-%", "s", " ", "(", "parent", " ", "url", " ", "-", " ", "%", "s", ")\"_", "%_", "(_", "tabs_", ",_", "depth_", ",_", "url_", ",_", "parent_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\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_", "broken", "Report_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "reporter_", "(_", "\"", "Bro", "ken", " ", "Link", "s", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "as", "\\u", "html_", "=_", "current_", "._", "test\\u", "config_", "._", "html_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "broken", "\\u", "link", "s", "\\u", "count_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "url_", ",_", "rd", "\\u", "obj_", ")_", "in_", "self_", "._", "results_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "as", "\\u", "html_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "print", "\\u", "url_", "=_", "\"<", "a", " ", "href", "=", "%", "s", "%", "s", " ", "target", "=\\\\\"", "\\u", "blank", "\\\\\">", "%", "s", "</", "a", ">\"_", "%_", "(_", "self_", "._", "home", "URL_", ",_", "url_", ",_", "url_", ")_", "\\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", "url_", "=_", "url_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "if_", "rd", "\\u", "obj_", "._", "is", "\\u", "broken", "_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "rd", "\\u", "obj_", "._", "thr", "ew", "\\u", "exception_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "msg_", "=_", "\"(", "Except", "ion", ")", " ", "%", "s", "\"_", "%_", "print", "\\u", "url_", "\\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", "\\u", "code_", "=_", "rd", "\\u", "obj_", "._", "return", "\\u", "http", "\\u", "code_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ticket_", "=_", "rd", "\\u", "obj_", "._", "the", "\\u", "ticket_", "(_", "as", "\\u", "html_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "parent_", "=_", "self_", "._", "url", "Parent", "List_", "[_", "url_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "as", "\\u", "html_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", " _", "parent_", "=_", "\"<", "a", " ", "href", "=", "%", "s", "%", "s", " ", "target", "=\\\\\"", "\\u", "blank", "\\\\\">", "Parent", "</", "a", ">\"_", "%_", "(_", "self_", "._", "home", "URL_", ",_", "parent_", ")_", "\\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 ", " ", " _", "parent_", "=_", "\"", "unknown", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "msg_", "=_", "\"%", "3d", ".", " ", "(%", "s", " ", "-", " ", "%", "s", ")", " ", "%", "s", " ", "call", "ed", " ", "from", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "broken", "\\u", "link", "s", "\\u", "count_", "+_", "1_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "http", "\\u", "code_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "ticket_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "print", "\\u", "url_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "parent_", "\\u\\u\\uNL\\u\\u\\u_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "reporter_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "broken", "\\u", "link", "s", "\\u", "count_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\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_", "time", "Report_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "operator_", "import_", "itemgetter_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "threshol", "d", "Link_", "=_", "{_", "}_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "linkt", "imes_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "url_", ",_", "rd", "\\u", "obj_", ")_", "in_", "self_", "._", "results_", "._", "items_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "duration_", "=_", "rd", "\\u", "obj_", "._", "get", "\\u", "duration_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "linkt", "imes_", "._", "append_", "(_", "duration_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "duration_", ">_", "self_", "._", "threshold_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "threshol", "d", "Link_", "[_", "url_", "]_", "=_", "duration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "reporter_", "(_", "\"", "Time", " ", "Analy", "sis", " ", "-", " ", "Link", "s", " ", "be", "yon", "d", " ", "threshol", "d", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "for_", "(_", "visit", "ed", "\\u", "url_", ",_", "duration_", ")_", "in_", "sorted_", "(_", "threshol", "d", "Link_", "._", "iteritems_", "(_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "key_", "=_", "itemgetter_", "(_", "1_", ")_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "reverse_", "=_", "True_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "self_", "._", "reporter_", "(_", "\"%", "s", " ", "too", "k", " ", "%", ".3", "f", " ", "second", "s", "\"_", "%_", "(_", "visit", "ed", "\\u", "url_", ",_", "duration_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "reporter_", "(_", "\"", "Time", " ", "Analy", "sis", " ", "-", " ", "summar", "y", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "total_", "=_", "len_", "(_", "linkt", "imes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "average_", "=_", "numpy_", "._", "mean_", "(_", "linkt", "imes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "std_", "=_", "numpy_", "._", "std_", "(_", "linkt", "imes_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "msg_", "=_", "\"%", "s", " ", "link", "s", " ", "visit", "ed", " ", "with", " ", "an", " ", "averag", "e", " ", "time", " ", "of", " ", "%", ".3", "f", " ", "and", " ", "standard", " ", "deviation", " ", "of", " ", "%", ".3", "f", "\"_", "%_", "(_", "total_", ",_", "average_", ",_", "std_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reporter_", "(_", "msg_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "scatter", "plot_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Meth", "od", " ", "to", " ", "draw", " ", "a", " ", "scatter", "plot", " ", "of", " ", "the", " ", "averag", "e", " ", "time", " ", "to", " ", "download", " ", "link", "s", "\\", "10", ";", " ", " ", " ", " ", "against", " ", "time", ".", " ", "Add", " ", "a", " ", "regress", "ion", " ", "line", " ", "to", " ", "show", " ", "the", " ", "trend", " ", "over", " ", "time", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "matplotlib_", "._", "backends_", "._", "back", "end", "\\u", "agg_", "import_", "Fig", "ure", "Can", "vas", "Agg", "_", "as_", "Fig", "ure", "Canvas_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Fig", "ure", "Canvas_", "=_", "Fig", "ure", "Canvas_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "matplotlib_", "._", "figure_", "import_", "Figure_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Figure_", "=_", "Figure_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "numpy_", "\\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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "import_", "xlr", "d_", "\\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 ", " _", "import", "\\u", "error_", "+=_", "\"", "ERROR", ":", " ", "the", " ", "xlr", "d", " ", "module", "s", " ", "is", " ", "need", "ed", " ", "to", " ", "record", " ", "timings", "\\\\", "n", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "rec", "\\u", "time", "\\u", "filename_", "=_", "self_", "._", "config_", "._", "record", "\\u", "timings", "\\u", "filename_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "workbook_", "=_", "xlr", "d_", "._", "open", "\\u", "workbook_", "(_", "filename_", "=_", "rec", "\\u", "time", "\\u", "filename_", ",_", "\\u\\u\\uNL\\u\\u\\u_", "format", "ting", "\\u", "info_", "=_", "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 ", " _", "return_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "import_", "numpy_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "On", "ly", " ", "include", " ", "the", " ", "mean", " ", "in", " ", "the", " ", "regress", "ion", " ", "values", " ", "if", " ", "there", " ", "are", " ", "at", " ", "leas", "t", " ", "10", " ", "URL", " ", "timings", "_", "\\u\\u\\uNL\\u\\u\\u_", "summary_", "=_", "self_", "._", "read", "\\u", "timings", "\\u", "sheet_", "(_", "workbook_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "(_", "date", "\\u", "summary_", ",_", "gv", "\\u", "mean_", ",_", "gv", "\\u", "std_", ",_", "m_", ",_", "b_", ")_", "=_", "self_", "._", "report", "\\u", "timings", "\\u", "summary_", "(_", "summary_", ",_", "mean", "\\u", "threshold_", "=_", "10_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "len_", "(_", "gv", "\\u", "mean_", ")_", "<=_", "2_", ":_", "\\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_", "fig_", "=_", "Figure_", "(_", "figsize_", "=_", "(_", "5_", ",_", "2.5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "canvas_", "=_", "self_", "._", "Fig", "ure", "Canvas_", "(_", "fig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "=_", "fig_", "._", "add", "\\u", "subplot_", "(_", "111_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "linear_", "=_", "numpy_", "._", "poly", "1d_", "(_", "[_", "m_", ",_", "b_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "denom_", "=_", "numpy_", "._", "max_", "(_", "gv", "\\u", "std_", ")_", "/_", "50_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "size_", "=_", "gv", "\\u", "std_", "/_", "denom_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "scatter_", "(_", "date", "\\u", "summary_", ",_", "gv", "\\u", "mean_", ",_", "marker_", "=_", "\"", "d", "\"_", ",_", "s_", "=_", "size_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "plot_", "(_", "date", "\\u", "summary_", ",_", "linear_", "(_", "date", "\\u", "summary_", ")_", ",_", "'--", "r", "'_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "chart_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "canvas_", "._", "print", "\\u", "figure_", "(_", "chart_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image_", "=_", "chart_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "base64", "Img_", "=_", "base64_", "._", "b64encode_", "(_", "image_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image_", "=_", "\"<", "img", " ", "src", "=\\\\\"", "data", ":", "image", "/", "png", ";", "base64", ",%", "s", "\\\\\">", "\"_", "%_", "base64", "Img_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reporter_", "(_", "\"", "Scatter", "plot", " ", "of", " ", "averag", "e", " ", "link", " ", "times", " ", "per", " ", "success", "ful", " ", "run", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reporter_", "(_", "image_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reporter_", "(_", "\"", "The", " ", "trend", " ", "line", " ", "has", " ", "a", " ", "current", " ", "slope", " ", "of", " ", "%", "s", "\"_", "%_", "m_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reporter_", "(_", "\"", "The", " ", "y", "-", "intercept", " ", "is", " ", "%", "s", " ", "second", "s", "\"_", "%_", "b_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Bro", "ken", "Link", "Test_", "(_", "Web", "2", "Unit", "Test_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "depth", "Report_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Meth", "od", " ", "to", " ", "draw", " ", "a", " ", "histo", "gram", " ", "of", " ", "the", " ", "number", " ", "of", " ", "new", " ", "link", "s", "\\", "10", ";", " ", " ", " ", " ", "discovere", "d", " ", "at", " ", "each", " ", "depth", ".", "\\", "10", ";", " ", " ", " ", " ", "(", "i", ".", "e", ".", " ", "show", " ", "how", " ", "many", " ", "link", "s", " ", "are", " ", "require", "d", " ", "to", " ", "reach", " ", "a", " ", "link", ")", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "try_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "from_", "matplotlib_", "._", "backends_", "._", "back", "end", "\\u", "agg_", "import_", "Fig", "ure", "Can", "vas", "Agg", "_", "as_", "Fig", "ure", "Canvas_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Fig", "ure", "Canvas_", "=_", "Fig", "ure", "Canvas_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "matplotlib_", "._", "figure_", "import_", "Figure_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "Figure_", "=_", "Figure_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numpy_", "import_", "arange_", "\\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_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "self_", "._", "reporter_", "(_", "\"", "Analy", "sis", " ", "of", " ", "link", " ", "depth", "\"_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "fig_", "=_", "Figure_", "(_", "figsize_", "=_", "(_", "4_", ",_", "2.5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Draw", " ", "a", " ", "histogram_", "\\u\\u\\uNL\\u\\u\\u_", "width_", "=_", "0.9_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "rect_", "=_", "[_", "0.12_", ",_", "0.08_", ",_", "0.9_", ",_", "0.85_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "=_", "fig_", "._", "add", "\\u", "axes_", "(_", "rect_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "left_", "=_", "arange_", "(_", "len_", "(_", "self_", "._", "link", "Depth_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "plot_", "=_", "ax_", "._", "bar_", "(_", "left_", ",_", "self_", "._", "link", "Depth_", ",_", "width_", "=_", "width_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "Add", " ", "the", " ", "x", " ", "axis", " ", "labels_", "\\u\\u\\uNL\\u\\u\\u_", "ax_", "._", "set\\u", "xticks_", "(_", "left_", "+_", "(_", "width_", "*_", "0.5_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "ax_", "._", "set\\u", "xticklabels_", "(_", "left_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "chart_", "=_", "String", "IO_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "canvas_", "=_", "self_", "._", "Fig", "ure", "Canvas_", "(_", "fig_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "canvas_", "._", "print", "\\u", "figure_", "(_", "chart_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image_", "=_", "chart_", "._", "getvalue_", "(_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "import_", "base64_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "base64", "Img_", "=_", "base64_", "._", "b64encode_", "(_", "image_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "image_", "=_", "\"<", "img", " ", "src", "=\\\\\"", "data", ":", "image", "/", "png", ";", "base64", ",%", "s", "\\\\\">", "\"_", "%_", "base64", "Img_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "self_", "._", "reporter_", "(_", "image_", ")_", "\\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_", "Report", "Data_", "(_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Class", " ", "to", " ", "hold", " ", "the", " ", "data", " ", "collected", " ", "from", " ", "the", " ", "smoke", " ", "test", " ", "read", "y", " ", "for", " ", "reporting", "\\", "10", ";", " ", " ", " ", " ", "Insta", "nce", "s", " ", "of", " ", "this", " ", "class", " ", "will", " ", "be", " ", "hel", "d", " ", "in", " ", "the", " ", "dictionar", "y", " ", "results", " ", "whi", "ch", " ", "will", "\\", "10", ";", " ", " ", " ", " ", "be", " ", "keyed", " ", "on", " ", "the", " ", "url", ".", " ", "Thi", "s", " ", "way", ",", " ", "in", " ", "an", " ", "atte", "mpt", " ", "to", " ", "minim", "ise", " ", "the", " ", "memory", " ", "used", ",", "\\", "10", ";", " ", " ", " ", " ", "the", " ", "url", " ", "doe", "sn", "'", "t", " ", "need", " ", "to", " ", "be", " ", "store", "d", " ", "in", " ", "this", " ", "class", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "The", " ", "class", " ", "will", " ", "have", " ", "the", " ", "follow", "ing", " ", "proper", "ties", "\\", "10", ";", " ", " ", " ", " ", "broken", ":", " ", "boolean", "\\", "10", ";", " ", " ", " ", " ", "exception", ":", " ", "boolean", "\\", "10", ";", " ", " ", " ", " ", "http", "\\u", "code", ":", " ", "integ", "er", "\\", "10", ";", " ", " ", " ", " ", "tick", "et", ":", " ", "URL", " ", "of", " ", "any", " ", "tick", "et", " ", "linked", " ", "with", " ", "this", " ", "url", "\\", "10", ";", " ", " ", " ", " ", "parent", ":", " ", "the", " ", "parent", " ", "URL", " ", "of", " ", "this", " ", "url", "\\", "10", ";", " ", " ", " ", " ", "depth", ":", " ", "how", " ", "deep", " ", "is", " ", "this", " ", "url", "\\", "10", ";", " ", " ", " ", " ", "duration", ":", " ", "how", " ", "long", " ", "did", " ", "it", " ", "take", " ", "to", " ", "get", " ", "the", " ", "url", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "[SEP]_", "class_", "Report", "Data_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "def_", "is", "\\u", "broken", "_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "self_", ",_", "\"", "broken", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "broken", "_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Report", "Data_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "thr", "ew", "\\u", "exception_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "self_", ",_", "\"", "exception", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "exception_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "False_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Report", "Data_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "return", "\\u", "http", "\\u", "code_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "self_", ",_", "\"", "http", "\\u", "code", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "http", "\\u", "code_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\"-\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Report", "Data_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "the", "\\u", "ticket_", "(_", "self_", ",_", "html_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "\"\"\"", "\\", "10", ";", " ", " ", " ", " ", "Sho", "ul", "d", " ", "only", " ", "have", " ", "a", " ", "tick", "et", " ", "if", " ", "it", " ", "is", " ", "broken", ",", "\\", "10", ";", " ", " ", " ", " ", "but", " ", "won", "'", "t", " ", "alw", "ay", "s", " ", "have", " ", "a", " ", "tick", "et", " ", "to", " ", "display", ".", "\\", "10", ";", " ", " ", " ", " ", "\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "hasattr_", "(_", "self_", ",_", "\"", "tick", "et", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "html_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "\"<", "a", " ", "href", "=", "%", "s", " ", "target", "=\\\\\"", "\\u", "blank", "\\\\\">", "Ticke", "t", "</", "a", ">\"_", "%_", "(_", "self_", "._", "ticket_", ")_", "\\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_", "\"", "Ticke", "t", ":", " ", "%", "s", "\"_", "%_", "(_", "self_", "._", "ticket_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\"", "no", " ", "tick", "et", "\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Report", "Data_", "(_", ")_", ":_", "\\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 ", " _", "if_", "hasattr_", "(_", "self_", ",_", "\"", "parent", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "parent_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Report", "Data_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "depth_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "self_", ",_", "\"", "depth", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "depth_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "Report", "Data_", "(_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "def_", "get", "\\u", "duration_", "(_", "self_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "hasattr_", "(_", "self_", ",_", "\"", "duration", "\"_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "return_", "self_", "._", "duration_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "return_", "0_" ]
[ 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,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2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ]
Unused import
cigroup-ol/windml/windml/preprocessing/nmar_destroyer.py
[ { "content": "\"\"\"\nCopyright (c) 2013,\nFabian Gieseke, Justin P. Heinermann, Oliver Kramer, Jendrik Poloczek,\nNils A. Treiber\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n Neither the name of the Computational Intelligence Group of the University\n of Oldenburg nor the names of its contributors may be used to endorse or\n promote products derived from this software without specific prior written\n permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\"\"\"\n\nfrom random import randint\nfrom math import floor\nfrom numpy import zeros, float32, int32, nan\n\n", "metadata": "root", "header": "['module', '___EOS___']", "index": 0 }, { "content": "class NMARDestroyer(object):", "metadata": "root.NMARDestroyer", "header": "['module', '___EOS___']", "index": 37 }, { "content": " def destroy(self, timeseries, **args):\n percentage = args['percentage']\n min_length = args['min_length']\n max_length = args['max_length']\n\n lseries = timeseries.shape[0]\n marked = 0\n marked_intervals = []\n while(marked < int(floor((lseries * percentage)))):\n start = randint(0, lseries - 1)\n end = randint(start + min_length, start + max_length)\n while(end > lseries - 1):\n start = randint(0, lseries - 1)\n end = randint(start + min_length, start + max_length)\n marked += (end - start)\n marked_intervals.append((start, end))\n\n exceptions = [0, lseries - 1]\n\n # exclude indices\n if('exclude' in args.keys()):\n exceptions = exceptions + args['exclude']\n\n removed_indices = []\n index_old = 0\n while index_old < lseries:\n for interval in marked_intervals:\n (start, end) = interval\n if((start <= index_old <= end) and index_old not in exceptions):\n removed_indices.append(index_old)\n break\n index_old += 1\n\n new_amount = lseries - len(removed_indices)\n # allocate new numpy array\n new_mat = zeros((new_amount,), dtype=[('date', int32),\\\n ('corrected_score', float32),\\\n ('speed', float32)])\n\n index_old = 0\n index_new = 0\n while index_old < lseries:\n if(index_old in removed_indices):\n index_old += 1\n else:\n new_mat[index_new] = timeseries[index_old]\n index_old += 1\n index_new += 1\n\n return new_mat, removed_indices", "metadata": "root.NMARDestroyer.destroy", "header": "['class', 'NMARDestroyer', '(', 'object', ')', ':', '___EOS___']", "index": 38 } ]
[ { "span": "from numpy import zeros, float32, int32, nan", "start_line": 35, "start_column": 0, "end_line": 35, "end_column": 44 } ]
[]
1
false
[ "[CLS]_", "Un", "used_", "import_", "[SEP]_", "module_", "\\u\\u\\uEOS\\u\\u\\u_", "\"\"\"", "\\", "10", ";", "Copy", "right", " ", "(", "c", ")", " ", "2013", ",", "\\", "10", ";", "Fab", "ian", " ", "Gi", "ese", "ke", ",", " ", "Justi", "n", " ", "P", ".", " ", "Hei", "ner", "man", "n", ",", " ", "Oli", "ver", " ", "Kra", "mer", ",", " ", "Jen", "dri", "k", " ", "Pol", "oc", "ze", "k", ",", "\\", "10", ";", "Ni", "ls", " ", "A", ".", " ", "Tre", "ibe", "r", "\\", "10", ";", "All", " ", "rights", " ", "reserve", "d", ".", "\\", "10", ";", "\\", "10", ";", "Redistributi", "on", " ", "and", " ", "use", " ", "in", " ", "source", " ", "and", " ", "binar", "y", " ", "forms", ",", " ", "with", " ", "or", " ", "with", "out", "\\", "10", ";", "modification", ",", " ", "are", " ", "permit", "ted", " ", "provided", " ", "tha", "t", " ", "the", " ", "follow", "ing", " ", "condition", "s", " ", "are", " ", "met", ":", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Redistributi", "ons", " ", "of", " ", "source", " ", "code", " ", "must", " ", "retain", " ", "the", " ", "above", " ", "copyr", "ight", " ", "notice", ",", " ", "this", "\\", "10", ";", " ", " ", " ", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Redistributi", "ons", " ", "in", " ", "binar", "y", " ", "form", " ", "must", " ", "reproduce", " ", "the", " ", "above", " ", "copyr", "ight", " ", "notice", ",", "\\", "10", ";", " ", " ", " ", " ", "this", " ", "list", " ", "of", " ", "condition", "s", " ", "and", " ", "the", " ", "follow", "ing", " ", "discl", "aime", "r", " ", "in", " ", "the", " ", "documentation", "\\", "10", ";", " ", " ", " ", " ", "and", "/", "or", " ", "other", " ", "material", "s", " ", "provided", " ", "with", " ", "the", " ", "distribu", "tion", ".", "\\", "10", ";", "\\", "10", ";", " ", " ", " ", " ", "Nei", "ther", " ", "the", " ", "name", " ", "of", " ", "the", " ", "Computation", "al", " ", "Intel", "lig", "ence", " ", "Group", " ", "of", " ", "the", " ", "Univers", "it", "y", "\\", "10", ";", " ", " ", " ", " ", "of", " ", "Old", "enb", "urg", " ", "nor", " ", "the", " ", "names", " ", "of", " ", "its", " ", "contributor", "s", " ", "may", " ", "be", " ", "used", " ", "to", " ", "endo", "rse", " ", "or", "\\", "10", ";", " ", " ", " ", " ", "promote", " ", "products", " ", "derive", "d", " ", "from", " ", "this", " ", "software", " ", "with", "out", " ", "specific", " ", "prior", " ", "writt", "en", "\\", "10", ";", " ", " ", " ", " ", "permissi", "on", ".", "\\", "10", ";", "\\", "10", ";", "THIS", " ", "SOFT", "WARE", " ", "IS", " ", "PROVI", "DED", " ", "BY", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ERS", " ", "AND", " ", "CONTRIB", "UTO", "RS", " ", "\"", "AS", " ", "IS", "\"", " ", "AND", "\\", "10", ";", "ANY", " ", "EXPR", "ESS", " ", "OR", " ", "IMPL", "IED", " ", "WAR", "RAN", "TIES", ",", " ", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "THE", " ", "IMPL", "IED", "\\", "10", ";", "WAR", "RAN", "TIES", " ", "OF", " ", "MER", "CHAN", "TAB", "ILI", "TY", " ", "AND", " ", "FIT", "NESS", " ", "FOR", " ", "A", " ", "PARTI", "CUL", "AR", " ", "PUR", "POS", "E", " ", "ARE", "\\", "10", ";", "DISC", "LAI", "MED", ".", " ", "IN", " ", "NO", " ", "EVENT", " ", "SHA", "LL", " ", "THE", " ", "COPY", "RIG", "HT", " ", "HOLD", "ER", " ", "OR", " ", "CONTRIB", "UTO", "RS", " ", "BE", " ", "LI", "AB", "LE", "\\", "10", ";", "FOR", " ", "ANY", " ", "DIRECT", ",", " ", "INDI", "RECT", ",", " ", "INC", "IDENT", "AL", ",", " ", "SPECIAL", ",", " ", "EXE", "MPL", "ARY", ",", " ", "OR", " ", "CONS", "EQU", "ENTI", "AL", "\\", "10", ";", "DA", "MAGE", "S", " ", "(", "INC", "LU", "DING", ",", " ", "BUT", " ", "NOT", " ", "LIMIT", "ED", " ", "TO", ",", " ", "PROC", "URE", "MENT", " ", "OF", " ", "SUBST", "ITU", "TE", " ", "GOOD", "S", " ", "OR", "\\", "10", ";", "SERVICES", ";", " ", "LOSS", " ", "OF", " ", "USE", ",", " ", "DATA", ",", " ", "OR", " ", "PROF", "IT", "S", ";", " ", "OR", " ", "BUS", "INE", "SS", " ", "INTER", "RU", "PTION", ")", " ", "HO", "WE", "VER", "\\", "10", ";", "CAU", "SED", " ", "AND", " ", "ON", " ", "ANY", " ", "THE", "ORY", " ", "OF", " ", "LI", "ABI", "LIT", "Y", ",", " ", "WHE", "THER", " ", "IN", " ", "CONTR", "ACT", ",", " ", "STRI", "CT", " ", "LI", "ABI", "LIT", "Y", ",", "\\", "10", ";", "OR", " ", "TOR", "T", " ", "(", "INC", "LU", "DING", " ", "NEG", "LIG", "ENCE", " ", "OR", " ", "OTHER", "WI", "SE", ")", " ", "ARI", "SIN", "G", " ", "IN", " ", "ANY", " ", "WAY", " ", "OUT", " ", "OF", " ", "THE", " ", "USE", "\\", "10", ";", "OF", " ", "THIS", " ", "SOFT", "WARE", ",", " ", "EVE", "N", " ", "IF", " ", "ADV", "ISE", "D", " ", "OF", " ", "THE", " ", "POS", "SIB", "ILI", "TY", " ", "OF", " ", "SUC", "H", " ", "DA", "MAGE", ".", "\\", "10", ";\"\"\"_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "from_", "random_", "import_", "randint_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "math_", "import_", "floor_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "from_", "numpy_", "import_", "zeros_", ",_", "float32_", ",_", "int32_", ",_", "nan_", "\\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_", "NM", "ARD", "estr", "oy", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "[SEP]_", "class_", "NM", "ARD", "estr", "oy", "er_", "(_", "object_", ")_", ":_", "\\u\\u\\uEOS\\u\\u\\u_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "def_", "destroy_", "(_", "self_", ",_", "timeseries_", ",_", "**_", "args_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "percentage_", "=_", "args_", "[_", "'", "percentage", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "min", "\\u", "length_", "=_", "args_", "[_", "'", "min", "\\u", "length", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "max", "\\u", "length_", "=_", "args_", "[_", "'", "max", "\\u", "length", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "lse", "ries_", "=_", "timeseries_", "._", "shape_", "[_", "0_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "marked", "_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "marked", "\\u", "intervals_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "(_", "marked", "_", "<_", "int_", "(_", "floor_", "(_", "(_", "lse", "ries_", "*_", "percentage_", ")_", ")_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "=_", "randint_", "(_", "0_", ",_", "lse", "ries_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end_", "=_", "randint_", "(_", "start_", "+_", "min", "\\u", "length_", ",_", "start_", "+_", "max", "\\u", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "(_", "end_", ">_", "lse", "ries_", "-_", "1_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "start_", "=_", "randint_", "(_", "0_", ",_", "lse", "ries_", "-_", "1_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "end_", "=_", "randint_", "(_", "start_", "+_", "min", "\\u", "length_", ",_", "start_", "+_", "max", "\\u", "length_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "marked", "_", "+=_", "(_", "end_", "-_", "start_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "marked", "\\u", "intervals_", "._", "append_", "(_", "(_", "start_", ",_", "end_", ")_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "exceptions_", "=_", "[_", "0_", ",_", "lse", "ries_", "-_", "1_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "#", " ", "exclu", "de", " ", "indices_", "\\u\\u\\uNL\\u\\u\\u_", "if_", "(_", "'", "exclu", "de", "'_", "in_", "args_", "._", "keys_", "(_", ")_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "exceptions_", "=_", "exceptions_", "+_", "args_", "[_", "'", "exclu", "de", "'_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "remove", "d\\u", "indices_", "=_", "[_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index", "\\u", "old_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "index", "\\u", "old_", "<_", "lse", "ries_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "for_", "interval_", "in_", "marked", "\\u", "intervals_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "(_", "start_", ",_", "end_", ")_", "=_", "interval_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "if_", "(_", "(_", "start_", "<=_", "index", "\\u", "old_", "<=_", "end_", ")_", "and_", "index", "\\u", "old_", "not_", "in_", "exceptions_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " ", "_", "remove", "d\\u", "indices_", "._", "append_", "(_", "index", "\\u", "old_", ")_", "\\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_", "index", "\\u", "old_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "\\u\\u\\uDEDENT\\u\\u\\u_", "new", "\\u", "amount_", "=_", "lse", "ries_", "-_", "len_", "(_", "remove", "d\\u", "indices_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "#", " ", "allocate", " ", "new", " ", "nump", "y", " ", "array_", "\\u\\u\\uNL\\u\\u\\u_", "new", "\\u", "mat_", "=_", "zeros_", "(_", "(_", "new", "\\u", "amount_", ",_", ")_", ",_", "dtype_", "=_", "[_", "(_", "'", "date", "'_", ",_", "int32_", ")_", ",_", "(_", "'", "corrected", "\\u", "score", "'_", ",_", "float32_", ")_", ",_", "(_", "'", "speed", "'_", ",_", "float32_", ")_", "]_", ")_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uNL\\u\\u\\u_", "index", "\\u", "old_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index", "\\u", "new_", "=_", "0_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "while_", "index", "\\u", "old_", "<_", "lse", "ries_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "if_", "(_", "index", "\\u", "old_", "in_", "remove", "d\\u", "indices_", ")_", ":_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "\\u\\u\\uINDENT\\u\\u\\u ", " _", "index", "\\u", "old_", "+=_", "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 ", " _", "new", "\\u", "mat_", "[_", "index", "\\u", "new_", "]_", "=_", "timeseries_", "[_", "index", "\\u", "old_", "]_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index", "\\u", "old_", "+=_", "1_", "\\u\\u\\uNEWLINE\\u\\u\\u_", "index", "\\u", "new_", "+=_", "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_", "return_", "new", "\\u", "mat_", ",_", "remove", "d\\u", "indices_" ]
[ 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,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